Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search a named range | Excel Worksheet Functions | |||
Search range of cells for word & return value for use in formula? | Excel Worksheet Functions | |||
Display cells(text) in one column based on cells which are present inother column | Excel Discussion (Misc queries) | |||
Query Named Range Return Single Column Value | Excel Worksheet Functions | |||
inserting a named range into new cells based on a named cell | Excel Discussion (Misc queries) |