![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
|
I have a macro that deletes a particular worksheet only to make a new version. When the macro deletes the worksheet, it prompts the user that the current sheet will be deleted. However, I have turn off screen updating so it doesn’t go to that particular sheet. Can I get the macro to show a custom message box that says, “Sheet A will be deleted. Proceed?” instead of the excel default. Can this be done?
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Try the following:
Code:
Sub DeleteWS()
Dim worksheetname As String
worksheetname = InputBox("What Worksheet do you want to delete?")
Application.DisplayAlerts = False
Message = MsgBox("Delete " & worksheetname & "?", vbYesNo)
If Message = vbYes Then Worksheets(worksheetname).Delete
End Sub
__________________
Kind regards, Al Chara |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|