ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   xlDialogFormulaFind Dialog Box (https://www.excelbanter.com/excel-programming/287091-xldialogformulafind-dialog-box.html)

Len

xlDialogFormulaFind Dialog Box
 
I wrote the following VBA code to Select all the sheets in
the workbook and then pop up the built in Find dialog box
so all the sheets would be searched. The dialog box pops
up but reports no data was not found even though the data
is in multiple sheets. It appears since the Sub / code is
still running and the sub hasn't gotten to the end Sub yet
it prevents the Find dialog from working properly. How
would I end the macro imenditily after the dialog pops up?
So control goes to the Find dialog. Thanks In Advance!

Code is Below:
Sub SearhAllSheets()
i = Sheets.Count
For Each ws In Worksheets
If ws.Name = Sheets(i).Name Then
Exit For
End If
ws.Select (False)
Next ws
Application.Dialogs(xlDialogFormulaFind).Show
End Sub



All times are GMT +1. The time now is 12:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com