2 Macro on 1 button

renman27

New Member
Joined
Dec 19, 2018
Messages
16
Hello, new to VBA. I have created a Record Macro to delete some formatting on my spreadsheet. It works fine with the button. I have had users use the clear button by accident...

I want to have a message box appear with "are you sure you want to clear" MsgBox "Ok to clear the schedule?", vbYesNo

But when I do this...

Only one works? It will still clear it...but the message will not appear. I have done seperatly and both work. so I added this to have both appear.



Sub Button1_Click()
Call Sub MsgBoxYesNo()
MsgBox "Are you sure you want to clear the sheet?", vbYesNo
End Sub'Macro1
Call 'Sub Test()
'
' Test Macro
'


'
Range("B22:M34").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=-6
Range("B4").Select
ActiveSheet.Paste
End Sub


Can someone guide me to what i need to change or provide the correct code?
 
AND.....if possible, upload your workbook to Dropbox so we can see the actual problem !
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
AND.....if possible, upload your workbook to Dropbox so we can see the actual problem !


So I will state what I need or what is going on for clarification.

I have a 2 week schedule tool. I am wanting to have a button so that it will automatically clear the conditional formatting from the boxes on schedule. I have the record macro tool that works fine. But i would like the button to have a popup message. Are you sure you want to clear etc.. I have the button located in a area where people might need to modify a cell. To keep from a error, I want to have the message and to be able to select no if its a mistake

Secondly...I don't see a dropbox area to upload? or should I send link...I am at work. so I am not sure if I can do either.
 
Upvote 0
Dropbox is not a section of this forum
You will need to go to this site, upload your workbook...then post a link to your upload back here.

https://www.dropbox.com/h
 
Upvote 0
I can't unfortunately...My company blocks everything for security...I will see if I have a flash drive I can put it on and take it home...
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,795
Members
451,589
Latest member
Harold14

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