Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting & Copying a Changing Range

Hi All,
I have data that I import on a weekly basis that has a variable numbe
of rows, same number of columns that I need a macro to find the end o
the new range, select the whole range and copy it. The data will alway
start in cell A1 and may be from 3 to 10 rows in length, extending t
column K.

Any suggestions?

Thanks,
Don Newto

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Selecting & Copying a Changing Range


Set myRange =
Range("A1").Resize(Cells(Rows.Count,"A"),End(xlUp) .Row,numCols)

substitute your value for n umber of columns for numcols

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"DNewton " wrote in message
...
Hi All,
I have data that I import on a weekly basis that has a variable number
of rows, same number of columns that I need a macro to find the end of
the new range, select the whole range and copy it. The data will always
start in cell A1 and may be from 3 to 10 rows in length, extending to
column K.

Any suggestions?

Thanks,
Don Newton


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Selecting & Copying a Changing Range

Range("A1").CurrentRegion.Copy Destination:= _
Workbooks("Data").Worksheets("Sheet3").Cells(rows. count,1).End(xlup)(2)

--
Regards,
Tom Ogilvy

"DNewton " wrote in message
...
Hi All,
I have data that I import on a weekly basis that has a variable number
of rows, same number of columns that I need a macro to find the end of
the new range, select the whole range and copy it. The data will always
start in cell A1 and may be from 3 to 10 rows in length, extending to
column K.

Any suggestions?

Thanks,
Don Newton


---
Message posted from http://www.ExcelForum.com/



Reply
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 formulas without changing the range gaelicamethyst Excel Discussion (Misc queries) 2 March 24th 09 03:41 PM
COPYING OFFSET FORMULA WITHOUT THE DATA RANGE CHANGING-DESPERATE SHELL Excel Worksheet Functions 5 August 10th 08 02:00 AM
Copying a named range with a changing cell reference [email protected] New Users to Excel 1 February 21st 08 07:49 AM
Copying Formatting Without Selecting Dan Gesshel Excel Programming 0 August 20th 03 01:12 AM
Selecting a constant changing Range Michael[_10_] Excel Programming 2 August 14th 03 01:30 PM


All times are GMT +1. The time now is 01:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"