Keyword Search for Multiple Sheets

edhogan1224

New Member
Joined
Apr 18, 2013
Messages
8
hello, i need a macro that i can click a "search" button, an input box pops up asking what id like to search, then searches through all the sheets in the workbook. Id like it to operate almost exactly like the (ctrl+f) search function, with the "find next" option. If there is a way i can bring this up when i click the button that'd be great too. I have tried recording a macro and using (ctrl+f), but it never actually records that action. I have used { Application.Dialogs(xlDialogFormulaFind).Show } in other instances, but this does not have the drop-down box allowing you to search across all the sheets. Any help would be appreciated. Thanks!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
You'll Need To Make A Userform.
If You Made One,Tell Us So We Give You Some Codes!
ZAX
 
Upvote 0
Welcome to the MrExcel board!
As ZAX is perhaps suggesting, try breaking your request up into smaller project pieces to resolve one at a time. It seems a useful project but I likely would try tackling the "Userform" or the "Sheet Searching" code first.

Try one or the other and show us what code you do have and then likely many here will give improvement suggestions.
Thanks -Chuck
 
Upvote 0
okay, i made a userform. Its simple, just a text box and two buttons "Find Next" and "Close". Is there anything else I can do to make it easier for you guys? sorry, im kinda new to this:rolleyes:
 
Upvote 0
chuckchuckit, i have a code that i found online and tweaked a bit to fit what i was doing but it is neither a keyword search, nor does it have the option to "Find Next." Here it is:


Sub Find_Data()
Dim datatoFind
Dim sheetCount As Integer
Dim counter As Integer
Dim currentSheet As Integer
On Error Resume Next
currentSheet = ActiveSheet.Index
datatoFind = InputBox("Please enter the value to search for")
If datatoFind = "" Then Exit Sub
sheetCount = ActiveWorkbook.Sheets.Count
For counter = 1 To sheetCount
Sheets(counter).Activate
Cells.Find(What:=datatoFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext).Activate
If ActiveCell.Value = datatoFind Then Exit Sub
Next counter
If ActiveCell.Value <> datatoFind Then
MsgBox ("Value not found")
Sheets(currentSheet).Activate
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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