Hi
I do a lot finding strings that can be anywhere in the workbook (Ctrl-F) so I decided to automate it with a macro (see code below)
Its a be crude but it works using the value of the cell i have preselected. The problem I have is that when I run the macro it finds that value fine but there may be others so i just click Next.
The issue I am having is that the Within: Value is set to sheet and I need to have automatically set to Workbook or there is the possibility that I inadvertently miss some values.
Can someone show me how this can be done please.
I do a lot finding strings that can be anywhere in the workbook (Ctrl-F) so I decided to automate it with a macro (see code below)
Its a be crude but it works using the value of the cell i have preselected. The problem I have is that when I run the macro it finds that value fine but there may be others so i just click Next.
The issue I am having is that the Within: Value is set to sheet and I need to have automatically set to Workbook or there is the possibility that I inadvertently miss some values.
Can someone show me how this can be done please.
VBA Code:
Sub DesFIND()
'
' DeFIND Macro
'
' Keyboard Shortcut: Ctrl+m
'
Dim Cellvalue As String
Cellvalue = ActiveCell.Value
'Selection.Copy
Cells.Find(What:=Cellvalue, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:= _
xlNext, MatchCase:=True, SearchFormat:=False).Activate
Application.CommandBars("Edit").Controls("Find...").Execute
End Sub