Command Button If Statement to halt macro

aka_krakur

Active Member
Joined
Jan 31, 2006
Messages
438
Okay, so I have a command button that formats the excel worksheet to look like this:
TEMPLATEShippedQuantity.xls
ABCDEFGHIJKLM
1JanFebMarAprMayJunJulAugSepOctNovDec
2RX Acculink
31998000000000000
41999000000000000
52000000000000000
62001000000000000
7200200000078189358298311212
82003317326327356320433387287350518473564
9200454358365051855465348310822736232325132229
102005246321842363247027783201258224462839212923022374
1120062156182726452258220124111966256197000
ShippedQty-SummarybyYr


I want to add something to the commandbutton macro that says if Cell A1 is blank then pop up a message box that says "Copy/Paste New Data from Viper Drill-Down" and then end Macro without continuing.

Because if they click the button and it executes, right now it'll mess up at this stage because it's expecting data in a whole different format.

Looks more like this when it's okay to click the Command Button:

[HTML removed by admin]
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Also need some kind of statement that says if while commandbutton1 is hidden if data is pasted into worksheet, to unhide commandbutton.
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

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