LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Macro to copy a specified range to a variable range

Hi Sean,

I'm afraid I'm not quite sure what your question is. If you're asking how
you can pass a dynamic range address then:

'Your loop to determine last row - Last row = X

Dim sRange As String

sRange = "A7:K" & X

Wks.("Sheet2").Range(sRange)......

If you're asking how to find the last row then you probably need to post
another question telling people on what basis you 'find' the last row (ie
blank "" or a particular value etc.)

Hope it's the first!

Best regards

John



"SWT" wrote in message
ups.com...
I have a spreadsheet with data in Sheet 2 Range (A4:K6) that I want to
copy to Sheet 2 Range (A7:K*) (* being the variable that will change
each time the macro is run. The * is determined by the number of rows
of data in Sheet 1). I have accomplished this task by using loops, but
it takes too long to complete the macro. I am now trying to have the
data copied to the specified range in one paste.

Sean



 
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
VBA help to copy variable range Eduardo Excel Discussion (Misc queries) 7 August 18th 08 09:16 PM
How to copy&paste a variable range rows and colums IK Excel Discussion (Misc queries) 1 August 30th 06 12:06 AM
Locating variable range to copy Eric C New Users to Excel 3 August 12th 05 10:23 AM
Copy only Visible Cells of a Variable Range... Damian Carrillo[_2_] Excel Programming 2 July 21st 05 01:12 AM
Copy/paste range variable between workbooks Jim73 Excel Programming 2 January 14th 05 08:17 AM


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