Created
January 24, 2017 06:04
-
-
Save cainhill/22b8424cfe1b4460866258bce6f097bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Zap() | |
Dim CurrentSheet As Worksheet | |
Dim FieldRow As Range | |
For Each CurrentSheet In ActiveWorkbook.Sheets | |
CurrentSheet.Activate | |
Set FieldRow = CurrentSheet.Columns(1).Find("Fields") | |
ApplySensibleDefaults FieldRow | |
Next | |
End Sub | |
Sub ApplySensibleDefaults(FieldRow As Range) | |
Dim Comments As Range | |
If Not FieldRow Is Nothing Then | |
' Apply an AutoFilter | |
Rows(FieldRow.Row).Select | |
Selection.AutoFilter | |
' Apply a freeze to the field headings | |
Rows(FieldRow.Offset(1, 0).Row).Select | |
ActiveWindow.FreezePanes = True | |
' Select the first usable content row | |
FieldRow.Offset(1, 0).Select | |
' Select all Comments fields in the first column | |
Columns("A:A").SpecialCells(xlCellTypeComments).Select | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment