Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to select a range based on values in 1 column
I'm trying to set up a macro that will allow me to select a range of cells.
The length of the range will vary, based on the results in one column. It could be a range with no results or possibly 150 results. (I'm sorting based on a variety of criteria and assigning a value from 1 to 4.) ie. A B C address1 name 1 1 address2 name2 2 address3 name3 2 address4 name4 3 How would I tell Excel to grab a range of cells where Column C holds a value of 2 so that I could grab the data associated with it and dump it elsewhere for output? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to select a range based on values in 1 column
Use the autofilter to filter on column C.
Data=Filter=Autofilter In column C, select 2 from the dropdown do it manually with the macro recorder on, then turn it off and check the code. If you copy a filtered range, only the visible cells are copied. -- Regards, Tom Ogilvy "ForestRamsey" wrote in message ... I'm trying to set up a macro that will allow me to select a range of cells. The length of the range will vary, based on the results in one column. It could be a range with no results or possibly 150 results. (I'm sorting based on a variety of criteria and assigning a value from 1 to 4.) ie. A B C address1 name 1 1 address2 name2 2 address3 name3 2 address4 name4 3 How would I tell Excel to grab a range of cells where Column C holds a value of 2 so that I could grab the data associated with it and dump it elsewhere for output? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to select a range based on values in 1 column
Thanks kindly for the help.
"Tom Ogilvy" wrote: Use the autofilter to filter on column C. Data=Filter=Autofilter In column C, select 2 from the dropdown do it manually with the macro recorder on, then turn it off and check the code. If you copy a filtered range, only the visible cells are copied. -- Regards, Tom Ogilvy "ForestRamsey" wrote in message ... I'm trying to set up a macro that will allow me to select a range of cells. The length of the range will vary, based on the results in one column. It could be a range with no results or possibly 150 results. (I'm sorting based on a variety of criteria and assigning a value from 1 to 4.) ie. A B C address1 name 1 1 address2 name2 2 address3 name3 2 address4 name4 3 How would I tell Excel to grab a range of cells where Column C holds a value of 2 so that I could grab the data associated with it and dump it elsewhere for output? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Count Unique Values in 1 Column based on Date Range in another Column | Excel Worksheet Functions | |||
Select Range based on column name and not A1 notations | Excel Discussion (Misc queries) | |||
Excel 2007 Display value based on values in another column range | Excel Worksheet Functions | |||
Select cells based on named Range and a column heading | Excel Programming | |||
Can you average data in 1 column based on a range of values in another? | Excel Worksheet Functions |