Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Range-Select Method Producing Error

Status
Not open for further replies.

bhujanga

Programmer
Oct 18, 2007
181
US
I have a macro which crashes with the error statement “Application Defined or Object Defined” error '1004" after a simple Range("A2").Select statement.
In desperation I tried:
With Sheets("MT 2010")
.Range("A2").Select
End With
with the same result.
I've tried putting that section of the code in it's own macro and it works just fine. It seems that there is nothing I can do within this particular macro to select a cell in this worksheet. I have several other places in the macro where I use the code, but it won't do it in this particular location. I even tried making it the first statements in the macro and it crashed, yet it works fine in its own macro. I've wasted a ton of time with this and am now contemplating becoming an alcoholic. What's the deal?
 
Dunno. We haven;'t really got enough information, since it is clear from what you say that this is only part of your code.
 
Hi,

1) Is sheet MT 2010 active when this statement executes? I'd guess not.

2) Do you really need to Select that cell on that sheet? There is lots of good stuff that you can do to cells without selecting them or having them in the active sheet or even in an active workbook, as long as they are properly referenced in your code.

However, the Select method can only be performed in an ActiveSheet.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top