Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Time Error 1004: Application Defined or Object Defined Error
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Export a chart in a GIF file. Run-time error '1004': Application-defined or object-defined error; | Excel Programming | |||
Run-time error 1004. Application-defined or object-defined error | Excel Programming | |||
Run Time Error 1004: Application-Defined or Object-Defined Error | Excel Programming | |||
Run-time Error 1004: Application-defined or Object-defined Error | Excel Programming | |||
Macro Run-time Error 1004 Application Defined or Object Defined Error | Excel Programming |