Running Macro on all the spreadsheets in a workbook

G

Guest

Guest
Question:
I have created macro for searching, and the macro can only search one spread at a time. So, I am wondering is it possible to make the macro search all the spreadsheets in a workbook at the same time?
Please Help me
Thank you in advance
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hello,

I beleive it is quite easy, I will call your macro that searches the worksheet as MySearchMacroName.
Just create a new macro as follows:


Sub SearchAllSheets()
For Each Worksheet In Worksheets
Sheets(Worksheet.Name).Select
Call MysearchMacroName
Next Worksheet
End Sub

Pierre
 
Upvote 0
Hello
I copy the code and paste it in ThisWorkBook and change the name of the macro. However it doesn't work
Did i do something wrong?
Thanks
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,731
Members
448,987
Latest member
marion_davis

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