Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Expand a range by rows and columns


Hi All,

I need to know how to expand a range by 2 rows. Here is what I have:

FinalRow = Range("A1").End(xlDown).Select

Now I need to come down 4 more rows and over 14 columns. I don't want to
use Cell References. I want to use relative references if at all possible.

How do I do that???

Your help is much appreciated.
--

Emma
www.bardpv.com
Tempe, Arizona
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Expand a range by rows and columns


Do you want A1 through the last used row in column A then extended to 14
columns?

Dim myRng as range
dim LastRow as long
with activesheet
LastRow = .cells(.rows.count,"A").end(xlup).row
set myrng = .range("A1", .cells(lastrow + 4, 14))
end with

myrng.select 'you probably don't have to select the range to work with it.



Emma Aumack wrote:

Hi All,

I need to know how to expand a range by 2 rows. Here is what I have:

FinalRow = Range("A1").End(xlDown).Select

Now I need to come down 4 more rows and over 14 columns. I don't want to
use Cell References. I want to use relative references if at all possible.

How do I do that???

Your help is much appreciated.
--

Emma
www.bardpv.com
Tempe, Arizona


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Expand a range by rows and columns

Another way using Resize..

Sub Macro()
Dim myRange As Range, finalRow As Long
finalRow = Range("A1").End(xlDown).Row
Range("A1").Resize(finalRow + 2, 14).Select
Set myRange = Range("A1").Resize(finalRow + 2, 14)
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Emma Aumack" wrote:

Hi All,

I need to know how to expand a range by 2 rows. Here is what I have:

FinalRow = Range("A1").End(xlDown).Select

Now I need to come down 4 more rows and over 14 columns. I don't want to
use Cell References. I want to use relative references if at all possible.

How do I do that???

Your help is much appreciated.
--

Emma
www.bardpv.com
Tempe, Arizona

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
Hidden rows/columns expand when referencing cells? tink Excel Worksheet Functions 1 October 9th 08 08:48 PM
How do I move the expand/collapse for rows and columns in Excel? JP Excel Worksheet Functions 0 May 4th 07 02:40 AM
How do I add the + and - signs to hide and expand rows/columns? Elsa Excel Discussion (Misc queries) 2 November 8th 06 10:07 PM
How do I auto expand hidden rows or columns? iamjbunni Excel Discussion (Misc queries) 2 July 29th 06 12:11 AM
Shrink and expand a number of columns/rows balles Excel Worksheet Functions 1 February 17th 06 04:31 PM


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