Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting cells
I've got a question that is really simple, but I just can't figure out
how to get the syntax right. I want the macro to pick a certain column, which is identified from user input, and then select a range below that to run a loop through. This is the current code: Range("o7:r7").Find(What:=MyValue3).Activate Range("d9:d360").Select (MyValue3 is defined by the user and is a week number found in the range O7 to R7). What I want to replace is the Range d9:d360 with a reference that will select from rows 9 to 360 no matter what column it's in. I tried Range("[RC]:[RC360]") to no avail. What am I doing wrong, and what will make this work? Thanks, a very frustrated beginner.... --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting cells
Is this what you're trying to do?
Dim intC As Integer Range("o7:r7").Find(What:=MyValue3).Activate intC = ActiveCell.Column Range(Cells(9, intC), Cells(360, intC)).Select HTH Paul -------------------------------------------------------------------------------------------------------------- Be advised to back up your WorkBook before attempting to make changes. -------------------------------------------------------------------------------------------------------------- I've got a question that is really simple, but I just can't figure out how to get the syntax right. I want the macro to pick a certain column, which is identified from user input, and then select a range below that to run a loop through. This is the current code: Range("o7:r7").Find(What:=MyValue3).Activate Range("d9:d360").Select (MyValue3 is defined by the user and is a week number found in the range O7 to R7). What I want to replace is the Range d9:d360 with a reference that will select from rows 9 to 360 no matter what column it's in. I tried Range("[RC]:[RC360]") to no avail. What am I doing wrong, and what will make this work? Thanks, a very frustrated beginner.... --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting more cells than I want | Excel Discussion (Misc queries) | |||
Selecting multiple cells, I can't see the cells highlighted | Excel Discussion (Misc queries) | |||
How to change shade of cells when selecting multiple cells | Excel Discussion (Misc queries) | |||
By selecting cells adjacent to cells tally sheet | Excel Worksheet Functions | |||
selecting cells | Excel Discussion (Misc queries) |