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

I have 100 spreadsheets. I defined a range 'MyRange' (insertNamedefine) in
each one of them. 'MyRange' in all the spreadsheets starts in cell A13 and
ends somewhere in column D. so in Spreadsheet 1 it could be A13:D30, in
spreadsheet 2 it could be A13:D50, etc.

I wrote a macro that will open each one of the 100 spreadsheets, copy
'MyRange' and paste it in a Master workbook. I now realised that i should
have included column E in my range as well .. so in spreadsheet 1 it should
be A13:E30, and so on.
I was going to open each one of the spreadsheets and expand the range
manually, but then i thought i already have a code that will open each one.
All i need is to add a line or 2 in there that changes the range and expands
it to include column E before it's copied and pasted.
How can i do that in VBA? I'm using Excel 2003.
I appreciate your help. Tendresse

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Extend a Range

this will select the range that you want...

ActiveWorkbook.Names("MyRange").RefersToRange.Resi ze(, 5).Select
--
HTH...

Jim Thomlinson


"Tendresse" wrote:

I have 100 spreadsheets. I defined a range 'MyRange' (insertNamedefine) in
each one of them. 'MyRange' in all the spreadsheets starts in cell A13 and
ends somewhere in column D. so in Spreadsheet 1 it could be A13:D30, in
spreadsheet 2 it could be A13:D50, etc.

I wrote a macro that will open each one of the 100 spreadsheets, copy
'MyRange' and paste it in a Master workbook. I now realised that i should
have included column E in my range as well .. so in spreadsheet 1 it should
be A13:E30, and so on.
I was going to open each one of the spreadsheets and expand the range
manually, but then i thought i already have a code that will open each one.
All i need is to add a line or 2 in there that changes the range and expands
it to include column E before it's copied and pasted.
How can i do that in VBA? I'm using Excel 2003.
I appreciate your help. Tendresse

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Extend a Range

It worked brilliantly .. thanks a lot :)

"Jim Thomlinson" wrote:

this will select the range that you want...

ActiveWorkbook.Names("MyRange").RefersToRange.Resi ze(, 5).Select
--
HTH...

Jim Thomlinson


"Tendresse" wrote:

I have 100 spreadsheets. I defined a range 'MyRange' (insertNamedefine) in
each one of them. 'MyRange' in all the spreadsheets starts in cell A13 and
ends somewhere in column D. so in Spreadsheet 1 it could be A13:D30, in
spreadsheet 2 it could be A13:D50, etc.

I wrote a macro that will open each one of the 100 spreadsheets, copy
'MyRange' and paste it in a Master workbook. I now realised that i should
have included column E in my range as well .. so in spreadsheet 1 it should
be A13:E30, and so on.
I was going to open each one of the spreadsheets and expand the range
manually, but then i thought i already have a code that will open each one.
All i need is to add a line or 2 in there that changes the range and expands
it to include column E before it's copied and pasted.
How can i do that in VBA? I'm using Excel 2003.
I appreciate your help. Tendresse

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
How to extend the active range Peter[_9_] Excel Discussion (Misc queries) 0 March 29th 09 06:39 PM
Extend Name range alex514 Excel Discussion (Misc queries) 2 February 22nd 08 05:32 PM
HOW TO EXTEND A NAMED RANGE ramana Excel Worksheet Functions 5 October 26th 05 08:53 AM
Painting Range - extend the range on the top part Shrikant Excel Discussion (Misc queries) 4 September 1st 05 11:18 AM
Extend Excels range Jack Excel Programming 9 December 24th 03 04:24 PM


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