Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Unique Values in 1 Column based on Date Range in another Column Brian Excel Worksheet Functions 14 May 17th 09 02:58 PM
Select Range based on column name and not A1 notations T.Vidak Excel Discussion (Misc queries) 3 July 16th 08 02:02 PM
Excel 2007 Display value based on values in another column range ChrisM Excel Worksheet Functions 2 September 4th 06 03:32 PM
Select cells based on named Range and a column heading achidsey Excel Programming 3 August 12th 05 03:55 AM
Can you average data in 1 column based on a range of values in another? kman24 Excel Worksheet Functions 2 November 17th 04 02:09 PM


All times are GMT +1. The time now is 10:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"