Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Compare a selected Range with a Named range and select cells that do not exist

Looks like the CF issue with trying to select a group of cells based on CF
shadings isn't going to happen.

So maybe I'll try a different avenue.

I'm using range A2:A27.
Cell C29 is populated by a ListBox.
The value in C29 will correspond to a Named cell range.

I'd like to find a way to compare each cell in the range to each cell in the
Name range. Range A2:A27 will have all the items that are in the defined
Name range. However, the defined Name range will not necessarily have all
the items that are in A2:A27. Whichever items were missing, I need to have
them selected.

Would this be done easier?

Thanks,
Paul


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Compare a selected Range with a Named range and select cells that do not exist

Assume everything is on Sheet3

Dim rng as Range, rng1 as Range, cell as Range
Dim res as Variant
with Worksheets("Sheet3")
set rng = .Range(.OleObjects("Listbox1").Object.value)
set rng1 = nothing

for each cell in .Range("A2:A27")
res = Application.Match(cell.Value,rng,0)
if iserror(res) then
if rng1 is nothing then
set rng1 = cell
else
set rng1 = union(rng1,cell)
end if
end if
Next
if not rng1 is nothing then
rng1.Select
End if


--
Regards,
Tom Ogilvy


"PCLIVE" wrote in message
...
Looks like the CF issue with trying to select a group of cells based on CF
shadings isn't going to happen.

So maybe I'll try a different avenue.

I'm using range A2:A27.
Cell C29 is populated by a ListBox.
The value in C29 will correspond to a Named cell range.

I'd like to find a way to compare each cell in the range to each cell in

the
Name range. Range A2:A27 will have all the items that are in the defined
Name range. However, the defined Name range will not necessarily have all
the items that are in A2:A27. Whichever items were missing, I need to

have
them selected.

Would this be done easier?

Thanks,
Paul




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
If 2 conditions exist in a range of cells Neophyte New Users to Excel 3 August 20th 08 11:47 AM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
Select cells based on named Range and a column heading achidsey Excel Programming 3 August 12th 05 03:55 AM
Detect if a selected cell is within a named range CraigB Excel Programming 2 November 25th 04 03:44 PM
Select only visible cells in a selected range DataFreakFromUtah Excel Programming 1 May 13th 04 03:26 AM


All times are GMT +1. The time now is 05:06 AM.

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

About Us

"It's about Microsoft Excel"