To start with, I am a novice at using VBA. Using guidance from this website, I'm getting the expected output, but I find it to be slow. Is there a better way? Also, I will need to 'save as' to a different file name at work; will all the macros transfer? See attached file. Thanks in advance.
Sub CIN()
Application.ScreenUpdating = False
Dim Rng As Range
Dim cell As Range
Rows.Hidden = False
Lastrow = Range("A" & Rows.Count).End(xlUp).Row '
Set Rng = Range("AO1:AO220") 'choose column where value exists
For Each cell In Rng
If cell.Value = "1" Then 'Change the value based on which the rows need to be hidden
cell.EntireRow.Hidden = True
End If
Next cell
Range("C6").Activate
ActiveSheet.PageSetup.PrintArea = "$A$4:$AJ$200"
End Sub
Sub CIN()
Application.ScreenUpdating = False
Dim Rng As Range
Dim cell As Range
Rows.Hidden = False
Lastrow = Range("A" & Rows.Count).End(xlUp).Row '
Set Rng = Range("AO1:AO220") 'choose column where value exists
For Each cell In Rng
If cell.Value = "1" Then 'Change the value based on which the rows need to be hidden
cell.EntireRow.Hidden = True
End If
Next cell
Range("C6").Activate
ActiveSheet.PageSetup.PrintArea = "$A$4:$AJ$200"
End Sub