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: 1,117
Default copying variable range not working

With Sheet2
.Visible = xlSheetVisible
.Cells.Clear
Set MyNewRange = .Range("a1:j500")
Range("a1").Select
End With

With Sheet1
Set MyRange = .Range("a1").End(xlDown).Offset(0, 8)
Range("a1").Select
End With

MyRange.Copy
MyNewRange.PasteSpecial Paste:=xlPasteAll

xxxxxxxxxxxxxxxxxxxxxxx

would somebody please hit me over the head
with a hammer & tell me why this macro
is giving me 500 rows copied of the one cell
located in column "I" in the last row of the
spreadsheet INSTEAD of copying the
range from a1:i<whatever.

obviously i am TELLING the macro to do
what it is doing; how do i tell it to do what
i want? "MyRange" is the problem. "My
NewRange" works fine (because it's not
variable!).

:c this macro was working perfectly well
but it was a very-newbie one that i am trying
to update with option explicit & making the
code more concise, etc.
thanks for your help & don't use a sledge-
hammer, please.
:)
susan

 
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
Copying a variable range of data from one worksheet to another. AllyB Excel Discussion (Misc queries) 3 March 2nd 09 11:37 PM
Copying range to variable number of rows nospaminlich Excel Programming 2 December 1st 05 11:34 PM
Copying RANGE of variable length Pele Excel Programming 2 October 19th 05 06:00 PM
Copying a variable range Brian Matlack[_9_] Excel Programming 6 October 17th 05 03:16 PM
range value with variable not working? James[_24_] Excel Programming 5 October 4th 04 02:43 PM


All times are GMT +1. The time now is 06:33 AM.

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"