Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
selection by values
Hello everybody.
I'd like to perform a selection by values. I mean, I have to detect, into a given column, which cells have a certain value. I'd be happy if I could get a range object or something with the resulting cells. I could perform many 'Find' commands, adding the cell address to a string on each 'Find' result, but that does not look that efficient. I wish that 'SpecialCells' could be used, but it doesn't look feasible, am I wrong? Is there a better way? Thank you. -- Guldo |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
selection by values
Hi
AFAIK you have to use FIND statements and may use Union to create a range of these cells -- Regards Frank Kabel Frankfurt, Germany "Guldo K" schrieb im Newsbeitrag ... Hello everybody. I'd like to perform a selection by values. I mean, I have to detect, into a given column, which cells have a certain value. I'd be happy if I could get a range object or something with the resulting cells. I could perform many 'Find' commands, adding the cell address to a string on each 'Find' result, but that does not look that efficient. I wish that 'SpecialCells' could be used, but it doesn't look feasible, am I wrong? Is there a better way? Thank you. -- Guldo |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
selection by values
"Frank Kabel" writes:
Hi AFAIK you have to use FIND statements and may use Union to create a range of these cells Thanks. That looks just like what I needed :) .... but I can't understand properly how to use it... It needs Ranges as arguments, so strings do not fit. Here's a piece of code: '''START Sub macro() UNIONE = "" NOME = "whatever" With Sheets("foglio1").Columns(3) PRIMO = .Find(NOME, LookIn:=xlValues, lookat:=xlWhole).Address SUCCESSIVO = PRIMO Do SUCCESSIVO = .FindNext(Range(SUCCESSIVO)).Address UNIONE = UNIONE & "Range(" & Chr(34) & SUCCESSIVO & Chr(34) & ")," Loop Until SUCCESSIVO = PRIMO UNIONE = Left(UNIONE, Len(UNIONE) - 1) Union(UNIONE).Select End With End Sub '''END So, how can I pass Ranges to Union inside a loop? Thank you. -- Guldo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Range of Values with different column selection | Excel Discussion (Misc queries) | |||
Formatting cell based upon values w/in a selection | New Users to Excel | |||
How do I assign a set of values to a selection from a drop list? | New Users to Excel | |||
Selection based on values in a cell | Excel Programming | |||
Add leading zero(s) to cell values in selection - An Example | Excel Programming |