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: 64
Default Copy a Variable range

Hi guys,

I know this question has been answered a number of times, however, no matter
what I try, I can't get it.

I have a worksheet where Range A1 to D46 has formulas to pull data from
another sheet. I am taking this range and doing Paste Special/Values to Cell
H1 then doing a sort so there are no blank rows.

I need to do 2 things..
1- find the last row to put a formula in Column L (ie: Sum(K1:K??- whatever
the last cell is)
and
2- Select K?? to H1 in order to copy the selected range.

I have tried the following to test if I could select the range, but it
selects the entire range from H1 to K45, I have no idea how to get around
this.

Dim lastRow As Long
lastRow = Cells(Rows.Count, "K").End(xlUp).Row
'set variable to the last used row in K
Range("H1:L" & lastRow).Copy


Help with this would be appreciated

--
Linda
 
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
Copy Variable Range to New Worksheet nospaminlich Excel Programming 3 August 3rd 07 01:20 AM
How to Copy and Paste a variable range IK Excel Programming 1 August 29th 06 09:04 PM
Macro to copy a specified range to a variable range SWT Excel Programming 4 October 21st 05 08:24 PM
Locating variable range to copy Eric C New Users to Excel 3 August 12th 05 10:23 AM


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