LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Excel VBA error

I'll run it tonight and see if I can ascertain which sheet the error is
occurring on.
--
R Ormerod


"Jim Thomlinson" wrote:

The queston becomes what is different about the sheet that the code crashes
on from the other sheets. Is the sheet protected? Is there no data on the
sheet? What are the values of MaxRowNet05 and a when the code crashes? Once
we figure that out the rest should fall into place...
--
HTH...

Jim Thomlinson


"R Ormerod" wrote:

Sheets("xxxx").Select

Dim MaxRowNet05 As Long
Dim a As Long
MaxRowNet05 = Range("E65536").End(xlUp).Row

For a = MaxRowNet05 To 2 Step -1
If Range("E" & a).Value < "C10" Then
'Range("E" & a).Font.Bold = True ' For testing
Range("E" & a).EntireRow.Delete ' Delete the row
End If
Next a

The macro runs through around 10 worksheets with the same code. Each sheet
is unhidden before and rehidden after the code.

--
R Ormerod


"Jim Thomlinson" wrote:

Post your code. It is hard to debug that which we can not see. The error you
have can be caused by a number of different things. The most likely culprest
are that you are tryuing to select a cell on a sheet that is not active or
that you are trying to select a cell which does not exist. Such as Cell A0 or
A65537...
--
HTH...

Jim Thomlinson


"R Ormerod" wrote:

After running an Excel VBA macro the following error always occurs:

Run-time error '1004':

Select method of Range Class failed

The 'Debug' button is not available and I have not been able to ascertain
why this is happening - any ideas for investigating?

--
R Ormerod

 
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
Excel 2007 - error saving file & error loading dll TinaF Excel Discussion (Misc queries) 0 July 1st 09 01:49 PM
Error: "Excel encountered an error and had to remove some formatti Carl Excel Discussion (Misc queries) 0 September 18th 06 06:39 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 02:30 PM.

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

About Us

"It's about Microsoft Excel"