![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 15
|
I have a list with either a "GO" or "STOP" in a particular cell. This is an extraordinarily long list, so I need to know which cells have "GO" in them. How can I get a list of those cell numbers?
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: London, UK
Posts: 167
|
alrighty, in another cell somewhere use the following (i assume your list is in column B, as an example)...
=COUNTIF("B:B","GO") play with it, you can put any range and any value to search for. |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Helena, MT
Posts: 13,690
|
I assume you know the Column your list is in. Let's Say Col A beginning with A2. In B2 (Insert a temporary col if needed) enter
=IF(A2="GO"),"A"&ROW(),""). Copy down the page. This will place the Cell address next to each cell in Col A that contains "GO". You can then copy this coluumn to a new location, remove the blanks and produce your list. |
|
|
|
|
|
#4 | |
|
New Member
Join Date: Mar 2002
Posts: 15
|
Thanks for the help. That solves of returning th cell address. Unfortunately, the lists are incredibly long (like 12000 rows), so it would be difficult to copy, paste, and take out the blanks of the lists. Is there an easier way to get excel to put the addresses in a range of cells (I know that only 9 out of 12000 cells have "GO")?
Quote:
|
|
|
|
|
|
|
#5 | |
|
New Member
Join Date: Mar 2002
Posts: 15
|
Thanks for the help. That solves of returning th cell address. Unfortunately, the lists are incredibly long (like 12000 rows), so it would be difficult to copy, paste, and take out the blanks of the lists. Is there an easier way to get excel to put the addresses in a range of cells (I know that only 9 out of 12000 cells have "GO")?
Quote:
|
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Posts: 202
|
could you use autofilter (data menu)?
|
|
|
|
|
|
#7 | |
|
New Member
Join Date: Mar 2002
Posts: 15
|
Thanks! That works.
Quote:
|
|
|
|
|
|
|
#8 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
You could use VBA, pretty simple:
Sub FindGo() Dim counter As Integer Dim rng As Range Set rng = Intersect(ActiveSheet.UsedRange, Columns("a")) For Each c In rng If UCase(c.Value) = "GO" Then counter = counter + 1 Range("b" & counter).Value = c.Address End If Next c End Sub
__________________
Kind regards, Al Chara |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|