The following formula works well if I define each cell (over and over), but I need a loop that will run down column A & B for hundreds of rows. I have tried and just caot seem to be able to write a loop that runs and stops when it hits an empty cell at the bottom. This needs to be able to run on multiple spreadsheets with different tab names.
Example of what works now: [ I want to have one formula that loops ] I currently have this written out for 100 lines, since I caot get a loop to work. :-(
Sub Hidelines()
If Range("A1").Value = "No" Then Rows("1:1").EntireRow.Hidden = True ElseIf Range("B1").Value = "NEVER" Then Rows("1:1").EntireRow.Hidden = True End If
If Range("A2").Value = "No" Then Rows("2:2").EntireRow.Hidden = True ElseIf Range("B2").Value = "NEVER" Then Rows("2:2").EntireRow.Hidden = True End If
If Range("A3").Value = "No" Then Range("E3").Select Rows("3:3").EntireRow.Hidden = True ElseIf Range("B3").Value = "NEVER" Then Rows("3:3").EntireRow.Hidden = True End If
End Sub
- - , .
برچسب:
نویسنده: استخدام کار