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: 3,101
Default statement not making sense

Can somebody explain to a beginning programmer why this statement does not
work?

wkb2.Worksheets(1).Range("a1", Range("i1").End(xlDown)).Copy _
Destination:=wkb1.Worksheets(1).Range("a2")

keep getting this error message.
Run-time error '1004': application-defined or object-defined error


If I write it this way, it works.
Set selRow = wkb2.Sheets(1).Range(ActiveCell, ActiveCell.End(xlDown))
wkb2.Worksheets(1).Range("a1", "i" & selRow.Rows.Count).Copy _
Destination:=wkb1.Worksheets(1).Range("a2")

I am trying to see why the one statement does not work and the two
statements works. I am assuming that it has to do with the row count or the
last row on the "i" column is empty but the error statement doesn't suggest
that. Does it have to do with references to objects? I don't mine having two
statements but I want to understand why it doesn't work. Thanks in advance
for your explaination.
 
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
file size makes no sense! michael.beckinsale Excel Programming 2 June 3rd 08 04:20 PM
Run-Time error 1004 issue just not making sense robs3131 Excel Programming 3 June 5th 07 05:24 AM
how to sense -1 value at any cell in a column amrezzat[_26_] Excel Programming 2 May 6th 06 11:42 PM
Converting a date from nonsense to sense RobertM Excel Discussion (Misc queries) 1 April 24th 06 02:21 PM
Does this make sense? Tom Excel Programming 0 August 24th 04 06:24 PM


All times are GMT +1. The time now is 03:40 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"