B
BEEJAY
Greetings All:
Trying to rework existing working code.
The original and my attempts are shown below.
Error shows up at "LastRow = Range............................
If I insert a "Dim Range" statement a completely different error shows up.
As you can see, I don't understand this at all.
Please help.
Option Explicit
Sub HoseCarriers_HPTrk_Hide()
' HIDES NON-SELECTED Rows in Specified Range
Application.ScreenUpdating = False
Dim RowNdx As Long
Dim LastRow As Long
' SELECT RANGE OF CELLS TO BE PROCESSED
' A573 thru G621
' Range("A573:G621").Select
' Original Code
' LastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
' Try to convert to work on Specified RANGE, Not complete W/Sheet.
LastRow = Range("A573:G621").Cells(Rows.Count, "B").End(xlUp).Row
' Continue with Original Code
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "B").Value = "x" Then
Rows(RowNdx).Hidden = True
End If
Next RowNdx
' Process Complete - Return all "states" to normal
Application.ScreenUpdating = True
End Sub
Trying to rework existing working code.
The original and my attempts are shown below.
Error shows up at "LastRow = Range............................
If I insert a "Dim Range" statement a completely different error shows up.
As you can see, I don't understand this at all.
Please help.
Option Explicit
Sub HoseCarriers_HPTrk_Hide()
' HIDES NON-SELECTED Rows in Specified Range
Application.ScreenUpdating = False
Dim RowNdx As Long
Dim LastRow As Long
' SELECT RANGE OF CELLS TO BE PROCESSED
' A573 thru G621
' Range("A573:G621").Select
' Original Code
' LastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
' Try to convert to work on Specified RANGE, Not complete W/Sheet.
LastRow = Range("A573:G621").Cells(Rows.Count, "B").End(xlUp).Row
' Continue with Original Code
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "B").Value = "x" Then
Rows(RowNdx).Hidden = True
End If
Next RowNdx
' Process Complete - Return all "states" to normal
Application.ScreenUpdating = True
End Sub