LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export a chart in a GIF file. Run-time error '1004': Application-defined or object-defined error; [email protected] Excel Programming 4 September 16th 07 11:09 PM
Run-time error 1004. Application-defined or object-defined error Martin Brennan Excel Programming 2 June 7th 07 01:22 PM
Run Time Error 1004: Application-Defined or Object-Defined Error Diana[_7_] Excel Programming 6 April 17th 07 04:21 PM
Run-time Error 1004: Application-defined or Object-defined Error Adrian Excel Programming 6 August 23rd 05 06:28 AM
Macro Run-time Error 1004 Application Defined or Object Defined Error Anddmx Excel Programming 6 June 9th 04 03:40 PM


All times are GMT +1. The time now is 03:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"