strongman86
Board Regular
- Joined
- Feb 15, 2017
- Messages
- 115
- Office Version
- 2019
- Platform
- Windows
Hi Lads,
I have macro below which hides all rows and leaves all rows with text ''APPLE'' in F column on Sheet2, it works ok, but the problem is that in this table all cells are referrencing to different sheet i.e. ='Sheet1'!A1 which means Marco hides all rows not containing APPLE and all the rest of my around 1000 rows with reference formulas in them. I there anything I can add to code so it ignores ''Empty''/Reference cells? Thanks.
I have macro below which hides all rows and leaves all rows with text ''APPLE'' in F column on Sheet2, it works ok, but the problem is that in this table all cells are referrencing to different sheet i.e. ='Sheet1'!A1 which means Marco hides all rows not containing APPLE and all the rest of my around 1000 rows with reference formulas in them. I there anything I can add to code so it ignores ''Empty''/Reference cells? Thanks.
HTML:
Sub hidesome() Dim r As Long Application.ScreenUpdating = False ActiveSheet.DisplayPageBreaks = False r = Range("F" & ActiveSheet.Rows.Count).End(xlUp).Row For r = 2 To r Select Case Cells(r, 6) Case "APPLE" Rows(r).Hidden = False Case Else Rows(r).Hidden = True End Select Next rEnd Sub