Using SendKeys to open Find box

kgkev

Well-known Member
Joined
Jun 24, 2008
Messages
1,282
Office Version
  1. 365
Platform
  1. Windows
I assumed
SendKeys "^F"

would work but it doesn't any ideas / alternatives?
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Why do you want to use Sendkeys at all, if I might ask?
 
Upvote 0
I don't really! I would prefer to do it in a better way?


I want to open the Find dialog box but I can't get it to function correctly.

Basically my macro just selects all sheets then should open th FIND box. The user than takes over.
 
Upvote 0
Try using:
Code:
   Application.CommandBars.FindControl(ID:=1849).Execute
 
Upvote 0
Code:
Sub multitabsearch()

Dim wsSheet As Worksheet
    For Each wsSheet In ActiveWorkbook.Worksheets
        If wsSheet.Visible Then
            wsSheet.Select Replace:=False
        End If
    Next wsSheet
Application.CommandBars.FindControl(ID:=1849).Execute

End Sub
gives a

Run_time 91
Object variable or With block variable not set.

Office 2000??
 
Upvote 0
could it be my version of xl then?
 
Upvote 0
I'm pretty sure the ID was the same back then. What do you get if you run:
Code:
Msgbox application.CommandBars(1).controls("Edit").controls("Find...").id
 
Upvote 0
Runtime 5
Invalid Procedure call or argument


Code:
Sub multitabsearch()

Dim wsSheet As Worksheet
    For Each wsSheet In ActiveWorkbook.Worksheets
        If wsSheet.Visible Then
            wsSheet.Select Replace:=False
        End If
    Next wsSheet
'Application.CommandBars.FindControl(ID:=1849).Execute
MsgBox Application.CommandBars(1).Controls("Edit").Controls("Find...").ID

End Sub
 
Upvote 0

Forum statistics

Threads
1,203,169
Messages
6,053,865
Members
444,690
Latest member
itgldmrt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top