Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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
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
Range of Values with different column selection CharlieR Excel Discussion (Misc queries) 1 June 3rd 09 07:14 AM
Formatting cell based upon values w/in a selection Carissa New Users to Excel 1 December 17th 08 07:04 PM
How do I assign a set of values to a selection from a drop list? Mike Bach New Users to Excel 1 March 7th 06 08:10 PM
Selection based on values in a cell Stewart[_2_] Excel Programming 1 September 3rd 03 12:40 PM
Add leading zero(s) to cell values in selection - An Example DataFreakFromUtah Excel Programming 1 August 10th 03 02:46 AM


All times are GMT +1. The time now is 05:56 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"