View Single Post
 
Old 10-16-2014, 02:09 AM
mike12 mike12 is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Oct 2014
Location: Brisbane , Australia
Posts: 10
mike12 is on a distinguished road
Default

ok so i searched other forum and came up with answer.
Below is the code attached to a command button,

Sub FindCellContent()
Dim Sh As Worksheet, foundCell As Range

'Search for CellContent in all Visible Worksheets
For Each Sh In ActiveWorkbook.Worksheets

If Sh.Visible = xlSheetVisible Then
'If you want to ignore the active sheet unmark the below line
'If ActiveSheet.Name <> Sh.Name Then
Set foundCell = Sh.Cells.Find(What:=ActiveCell, _
After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext)

If Not foundCell Is Nothing Then
If foundCell.Address(External:=True) <> _
ActiveCell.Address(External:=True) Then _
Application.Goto foundCell: Exit For
End If

'/If you want to ignore the active sheet
'End If
End If
Next
If foundCell Is Nothing Then _
MsgBox ActiveCell & " not found in this workbook"

End Sub
Reply With Quote