Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hidden rows/columns expand when referencing cells? | Excel Worksheet Functions | |||
How do I move the expand/collapse for rows and columns in Excel? | Excel Worksheet Functions | |||
How do I add the + and - signs to hide and expand rows/columns? | Excel Discussion (Misc queries) | |||
How do I auto expand hidden rows or columns? | Excel Discussion (Misc queries) | |||
Shrink and expand a number of columns/rows | Excel Worksheet Functions |