Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Trying to convert this code to sheet 1 only, one column only (col T) and list all dupes in a msgbox with cell.address.
The search item could be for a number or text. Thanks. Howard Sub FindSheetsWithID() '/ code by Garry ' Looks for an ID on all sheets except "Sheet1", ' and notifies the result of the search. Dim ws As Worksheet, Rng As Range Dim sID$, sIdShts$, sMsg$ Dim bFoundID As Boolean sID = InputBox("Enter a Client ID number") If Trim(sID) = "" Then Exit Sub For Each ws In ThisWorkbook.Worksheets If Not ws.Name = "Sheet1" Then Set Rng = ws.UsedRange.Find(What:=sID, _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByColumns) If Not Rng Is Nothing Then bFoundID = True sIdShts = sIdShts & ",'" & ws.Name & "'!" & Rng.Address End If End If Next ws If bFoundID Then sMsg = "The ID (" & sID & ") was found on the following sheets:" sMsg = sMsg & vbLf & vbLf sMsg = sMsg & Join(Split(Mid(sIdShts, 2), ","), vbLf) Else sMsg = "ID not found" End If MsgBox sMsg End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MsgBox cell address | Excel Programming | |||
Returning a cell address in a msgbox, by selection via inputbox Ty | Excel Discussion (Misc queries) | |||
Convert street address to zip code | Excel Worksheet Functions | |||
Find Blank Cells and List Each Cell Address in Another Sheet | Excel Programming |