bonescoster
New Member
- Joined
- Mar 16, 2015
- Messages
- 18
Hey everyone,
I am using the following code to hide rows in a workbook where column A has the value "Hide". However going through 500 lines seems to take a long time. I am wondering if there is a better way to have excel search and select all rows where the value of column A is "Hide" and hide the rows all at once instead of going through each line one at a time.
Any suggestions?
Thanks in advance for your help.
-Stephen
I am using the following code to hide rows in a workbook where column A has the value "Hide". However going through 500 lines seems to take a long time. I am wondering if there is a better way to have excel search and select all rows where the value of column A is "Hide" and hide the rows all at once instead of going through each line one at a time.
Any suggestions?
Code:
Sub Hide_Rows()
'Unhide all Rows Before Beginning
Call Unhide
'Define Row Numbers to Examine
For rownum = 1 To 500
'If Statement
If ActiveSheet.Cells(rownum, 1).Value = "Hide" Then
ActiveSheet.Rows(rownum).Hidden = True
End If
'Loop
Next
End Sub
Thanks in advance for your help.
-Stephen