View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
kdp145 kdp145 is offline
external usenet poster
 
Posts: 1
Default error 1004 - application defined or object defined error


i am getting this error when i execute the following code:

Workbooks("Raw Luggage Data.xls").Activate <-- executes fine

Sheets("Raw Luggage - 1").Select <--executes
fine
Range("A7").Select <---gives
error
ActiveCell.End(xlDown).Select
lastrow = ActiveCell.Row
MsgBox lastrow

this code is in a different file called "get data macro" and i have
this same exact code in a macro in "raw luggage data" where it works
fine. i also tried to comment out the 3rd line and then execute the
code and it works. the only prob is that i would have to manually
select cell A7. i dont know why it doesnt work? could it be becasue the
macro is in a diff file?

edit: lastrow is already declared


--
kdp145
------------------------------------------------------------------------
kdp145's Profile: http://www.excelforum.com/member.php...o&userid=29594
View this thread: http://www.excelforum.com/showthread...hreadid=509388