Please note that I don't understand Modules, Sub/End Sub, etc so I'll need the exact/complete code if at all possible.
I have 2 tabs, tab 1 is called Instructions and tab 2 is called CCAN Data.
I recorded a macro (and cleaned it up just a bit based on what vb code I do know) and here's my code:
What I'd like to add is a pop-up message that says:
Are you sure you want to delete all data on the CCAN Data tab? Yes / No
And the code only executes if the user clicks Yes, and nothing happens if the user clicks No.
Again, I really don't know VB Code (I'm just dangerous enough recording macros if you know what I mean). Can you please provide the complete set of code including what I already have shown above?
Many thanks in advance!!!
I have 2 tabs, tab 1 is called Instructions and tab 2 is called CCAN Data.
I recorded a macro (and cleaned it up just a bit based on what vb code I do know) and here's my code:
Sub ClearCCAN()
'
' ClearCCAN Macro
'
' Keyboard Shortcut: Ctrl+q
'
Sheets("CCAN Data").Select
Rows("2:1048576").Select
Selection.Delete Shift:=xlUp
Range("A2").Select
Sheets("Instructions").Select
Range("A6").Select
End Sub
I added a button on tab "Instructions" and I assigned my Macro to this button. When the user clicks this button, all data on rows 2-1048576 are deleted on the tab called "CCAN Data" and the user is returned to cell A6 on the Instructions tab.'
' ClearCCAN Macro
'
' Keyboard Shortcut: Ctrl+q
'
Sheets("CCAN Data").Select
Rows("2:1048576").Select
Selection.Delete Shift:=xlUp
Range("A2").Select
Sheets("Instructions").Select
Range("A6").Select
End Sub
What I'd like to add is a pop-up message that says:
Are you sure you want to delete all data on the CCAN Data tab? Yes / No
And the code only executes if the user clicks Yes, and nothing happens if the user clicks No.
Again, I really don't know VB Code (I'm just dangerous enough recording macros if you know what I mean). Can you please provide the complete set of code including what I already have shown above?
Many thanks in advance!!!