Firecop1348
Board Regular
- Joined
- Oct 24, 2009
- Messages
- 101
Im using this macro to find a number within my sheet. I need to change it to be able to find a NAME within a sheet of my workbook. I thought it would be easy, but I just cant seem to make it happen.
Any help would be nice . ... AGAIN. LOL
Any help would be nice . ... AGAIN. LOL
HTML:
Sub Find_the_Number()
Dim ws As Worksheet, ctr
ctr = 0
theNum = InputBox("Please enter the number to seek.", _
"Search Criteria")
For Each ws In ActiveWorkbook.Worksheets
ws.Select
For Each cell In ws.UsedRange
cell.Select
If ActiveCell.Value = Val(theNum) Then
ctr = 1
Exit Sub
End If
Next
Next
Sheets("Main").Select
ActiveWindow.SmallScroll Down:=-24
Range("G1").Select
If ctr = 0 Then
MsgBox "No sheet contains the the number: " & _
theNum, vbOKOnly, "Not Found"
Else
End If
End Sub