Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Search cells in a column and return yes/no if they are present in named range

Hi,

Please help, I'm trying to select a particular column and then search
each cell in that column to see if any of the values exist in a named
range, i want to do this for each sheet in the workbook.

For example: I have 4 worksheets in by workbook, 3 of which all
contain Site field (column B). The 4th sheet contains a named range
("SITE") I want to check that each site in column B (all sheets)exists
in the named range on the 4th sheet.

Is this possible, thank you in advance

Felicity
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Search cells in a column and return yes/no if they are present in named range

Felicity wrote:
Please help, I'm trying to select a particular column and then search
each cell in that column to see if any of the values exist in a named
range, i want to do this for each sheet in the workbook.

For example: I have 4 worksheets in by workbook, 3 of which all
contain Site field (column B). The 4th sheet contains a named range
("SITE") I want to check that each site in column B (all sheets)exists
in the named range on the 4th sheet.


This shoud be a start:
Sub MacName()
Call SubName("Sheet1")
Call SubName("Sheet2")
Call SubName("Sheet3")
End Sub
Sub SubName(WSName$)
Dim zCell1 As Range, zCell2 As Range, s$
For Each zCell1 In Worksheets(WSName).Range("B:B")
s = zCell1.Value ' site
If s < "" Then
For Each zCell2 In Range("SITE")
If zCell2.Value = s Then
MsgBox "Match: " & s
GoTo NextzCell1 ' sorry about the goto
End If
Next zCell2
MsgBox "Nomatch: " & s
End If
NextzCell1:
Next zCell1
End Sub



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
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
Search a named range rhhince[_2_] Excel Worksheet Functions 1 August 27th 09 06:19 AM
Search range of cells for word & return value for use in formula? Peter Psych Teacher Excel Worksheet Functions 2 October 19th 08 11:25 PM
Display cells(text) in one column based on cells which are present inother column [email protected] Excel Discussion (Misc queries) 1 May 12th 08 01:40 PM
Query Named Range Return Single Column Value JeffP-> Excel Worksheet Functions 5 November 29th 07 10:30 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM


All times are GMT +1. The time now is 11:04 AM.

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"