Loop through workbook and rename worksheets with dialog box

theprincipal78

Board Regular
Joined
Aug 5, 2009
Messages
68
Hi all

I'm relatively new to vba.
as the title indicates I'm trying to loop through a workbook and rename all visible worksheets with a dialog box.

I was trying to combine something like the below.
Instead of calling every sheetname in a msgbox I rename every sheet with a dialog box.



Sub MsgBox_CallAllMySheets()

Dim sht As Worksheet

For Each sht In Sheets

'call sheetname in a msgbox
'MsgBox_PartOfCallAllMySheets (sht.Name)

'rename sheet with test application
Application.Dialogs(284).Show

Next sht

End Sub


I'm greatfull for any assistance.

thanks
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Try this

Sub reNameSheets1A()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Activate
If ws.Visible = xlSheetVisible Then
Application.Dialogs(284).Show
End If
Next ws
End Sub
 
Upvote 0
Happy to help and thank you for letting me know you have a working solution.
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

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