LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Dave Peterson
 
Posts: n/a
Default Resize Range - Macro

I'm confused as the others, but maybe....

Dim myRng as range
with activesheet
set myrng = .range("myRange")
'this doesn't make much sense to me
'but it shows how to find the number of rows/columns in myrng
myrng.resize(myrng.rows.count,myrng.columns.count) .select
'or
'make it 10 columns wide
myrng.resize(myrng.rows.count,10).select
'which would be equivalent to:
myrng.resize(,10).select
end with

(if you specify the rows/columns to resize, then it won't be changed.)

Closer???


????? wrote:

Hi Sam,

Thanks again for your response.

Actually, what I'm looking for is how to write a macro for the variable
(xlDown)of "3" (rows) on the macro below

ActiveCell.Resize(3, 10).Select

I need this macro for a lot of things because I name a range to go to, use
the REVISED macro above, then, I can use it for a lot of things, like copy,
put borders, insert rows, etc. I have been trying to get the right macro for
this.

Thanks again.

"Sam" wrote:

? so if i understand, you want to look at the current selection, and copy
? an area 10 columns across and n rows down (n= number of used rows under
? the selection) and past in a range called 'otherrange'?:
?
? Range(ActiveCell.Range("a1"), ActiveCell.End(xlDown).Offset(0,
? 10)).Copy Range("otherrange")
?
?


--

Dave Peterson
 
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
Use Range Name in Macro Blue Hornet Excel Worksheet Functions 3 August 13th 05 06:02 PM
Macro to copy range from Excel files in folder nc Excel Discussion (Misc queries) 1 June 15th 05 11:11 AM
Is it possible to set a variable range in a macro? Mary About this forum 0 June 12th 05 06:26 PM
Macro - define cell range for a sum function Fad Excel Discussion (Misc queries) 2 June 6th 05 12:40 PM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM


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