Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Range using variables
I need to select a range from the active cell 16 rows down and a variable
number of columns to the left. I've named my variable "MyMonths", but I'm not sure how to incorporate it into a range address. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Range using variables
Nevermind. I answered my own question.
ActiveCell.Range(Cells(1, 1), Cells(16, MyMonths)).Select "StephanieH" wrote: I need to select a range from the active cell 16 rows down and a variable number of columns to the left. I've named my variable "MyMonths", but I'm not sure how to incorporate it into a range address. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Range using variables
Define "variable number of columns to the left". Back to Column A or ??? If
Column A then... dim rngTo Select as range dim wks as worksheet set wks = activesheet set rngtoSelect = wks.range(activecell, .cells(activecell.row + 16, "A")) rngtoselect.select -- HTH... Jim Thomlinson "StephanieH" wrote: I need to select a range from the active cell 16 rows down and a variable number of columns to the left. I've named my variable "MyMonths", but I'm not sure how to incorporate it into a range address. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Range using variables
Activecell.Offset().MyMonths).Resize(16,MyMonths). Select
-- HTH RP (remove nothere from the email address if mailing direct) "StephanieH" wrote in message ... I need to select a range from the active cell 16 rows down and a variable number of columns to the left. I've named my variable "MyMonths", but I'm not sure how to incorporate it into a range address. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Range using variables
I thought I had it before, but only close.
It's working now. Thanks Bob and Jim. "Bob Phillips" wrote: Activecell.Offset().MyMonths).Resize(16,MyMonths). Select -- HTH RP (remove nothere from the email address if mailing direct) "StephanieH" wrote in message ... I need to select a range from the active cell 16 rows down and a variable number of columns to the left. I've named my variable "MyMonths", but I'm not sure how to incorporate it into a range address. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I select on two variables in a range of data in excel | Excel Worksheet Functions | |||
Select one variable from a list of variables by clicking one cell | Excel Discussion (Misc queries) | |||
Range.Select Using Variables - need syntax | Excel Discussion (Misc queries) | |||
VBA-Select several ranges using variables | Excel Programming | |||
Using variables to select a range | Excel Programming |