Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable for column selection
Hi,
I use the script; Range("D" & Rows.Count).End(xlUp).Offset(1).Select ...to check for the last row in a given column. but I need to change the column D to a variable. I tried different ways to write that without success. Appreciate if someone can give a hint! Thanks! -- Mats W. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable for column selection
One way:
Dim colvar As String colvar = "D" Range(colvar & Rows.Count).End(xlUp).Offset(1).Select "Mats W." wrote: Hi, I use the script; Range("D" & Rows.Count).End(xlUp).Offset(1).Select ..to check for the last row in a given column. but I need to change the column D to a variable. I tried different ways to write that without success. Appreciate if someone can give a hint! Thanks! -- Mats W. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable for column selection
Dim iCol As Long
Cells(Rows.Count, iCol).End(xlUp).Offset(1).Select -- HTH Bob Phillips "Mats W." wrote in message ... Hi, I use the script; Range("D" & Rows.Count).End(xlUp).Offset(1).Select ..to check for the last row in a given column. but I need to change the column D to a variable. I tried different ways to write that without success. Appreciate if someone can give a hint! Thanks! -- Mats W. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I include an all tab in a pivot variable selection | Excel Discussion (Misc queries) | |||
Sum cells based on a row variable and seperate column variable | Excel Worksheet Functions | |||
Assign a variable from a Listbox selection. | Excel Programming | |||
Assign a variable from a Listbox selection. | Excel Programming | |||
Assign a variable from a Listbox selection. | Excel Programming |