Sunday, September 18, 2016

Check Cell Content before Printing

Check Cell Content before Printing

Is there a macro that can be written that will check the contents of range A1:A2 in sheet1 and bring up a box telling the user to "Input the correct data in cell A1 and A2" if they have been left blank?
 
Thanks

Solutions to the Problem Check Cell Content before Printing

Download SmartPCFixer to Fix It (Free)

Put the following event macro in the workbook code area:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Set sh = Sheets("Sheet1")
If sh.Range("A1") = "" Or sh.Range("A2") = "" Then
    Cancel = True
    MsgBox "Input the correct data in cell A1 and A2"
End If
End Sub


Because it is workbook code, it is very easy to install and use:

   1.
right-click the tiny Excel icon just to the left of File on the Menu Bar
   2.
select View Code - this brings up a VBE window
   3.
paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.
If you are using a version of Excel later then 2003, you must save
the file as .xlsm rather than .xlsx

To remove the macro:

   1.
bring up the VBE windows as above
   2.
clear the code out
   3.
close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (workbook code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

Macros must be enabled for this to work!

Run CHKDSK to Fix Check Cell Content before Printing

  • Go to the Start button.
  • In the Search box, type "cmd" (without quotes) and press Enter.
  • At the command prompt, type "chkdsk /r /f" (without quotes) and press Enter.
  • Reboot your computer.
NOTE: You might receive an error message that states:

"Access denied as you do not have significant privileges. You have to invoke this utility in elevated mode."

If you receive the above error message, it means you are not logged into you computer as an Administrator. If that's the case, follow these steps to run the command prompt in elevated mode:

  • Go to theStart button.
  • Go to "All Programs > Accessories" and right click on "Command Prompt".
  • Select "Run as Administrator".
  • In the Search box, type "cmd" (without quotes) and press Enter.
  • At the command prompt, type "chkdsk /r /f" (without quotes) and press Enter.
  • Reboot your computer.

Recommended Method to Fix the Problem: Check Cell Content before Printing:

How to Fix Check Cell Content before Printing with SmartPCFixer?

1. Download SmartPCFixer . Install it on your computer.  Click Scan, and it will perform a scan for your computer. The junk files will be shown in the list.

2. After the scan is done, you can see the errors and problems need to be fixed. Click Fix All.

3. When the Fixing part is done, your computer has been speeded up and the errors have been removed


Related: How Can You Update & Download Toshiba Satellite 5105-S501 Intel PRO 10/100 Driver v.8.0.43.0,How to Update & Download Toshiba Satellite C655D-S5139 BookPlace v.2.2.7530 driver,Method to Update & Download Toshiba Satellite L655-S5073 Realtek Wireless LAN Driver v.2.00.0011,Method to Update & Download Toshiba Satellite L840-ST2N01 Sleep Utility v.1.4.0022.000104 driver,Best Way to Update & Download Toshiba Satellite Pro S300-EZ2502 Extended Tiles for Windows Mobility Center v.1.01 driver,Best Way to Download NVidia GeForce 6100 VGA Driver v.304.51 Certified,How Can You Update & Download NVidia GeForce 9300/nForce 730i VGA Driver v.310.19 Certified,Method to Download NVidia GeForce GT 330M Driver v.340.65,How Can I Update & Download NVidia GeForce GTX 590 Driver v.280.26 WHQL,Method to Download NVidia Tesla C2050 Driver v.319.17,Way to Download RealTek RTL8100C(L) Driver v.5.01,Way to Download RealTek RTL8100E Drivers v.694,Way to Update & Download RealTek RTL8101L Auto Installation Program v.6.110 driver,Method to Update & Download RealTek RTL8111G PXE and RPL ROM code v.2.58 driver,How to Update & Download RealTek RTL8411B(N) Driver v.10.003,Best Way to Update & Download ASUS A53SV nVidia Graphics Driver v.8.17.12.6686,Method to Herunterladen ASUS K75VJ Intel Rapid Storage Technology Treiber v.11.6.0.1030,How Can You Update & Download ASUS CG8580 Intel Chipset Driver v.9.3.0.1019,Method to Update & Download ASUS K41VD Intel INF Update Driver v.9.1.1.1015,Way to Update & Download ASUS Pro70T NB Probe v.3.0.0026 driver,Can't Download PP Templates Automatically To Windows 7 W/IE 8,Can't Change Drive Letter - Vista,Can't Change Homegroup Sharing Permission,Can't Connect XP Shared Printer To Win7 Except As A Local Printer.__,Can You Connect The LAN Adapter For Wii On Your Windows 7 Laptop?
Read More: Troubleshooter of Error: CD Drive Not Enabled when Booting and Gone After Sleep,How Can I Fix - check valid directx installation message on Skype?,Troubleshooting:click-2 run configure failure Error,cant dowload anything when i try it just comes up internet explorer is not working and stops the program,certain websites refuse to work since updating to windows 8.1,Can't access c drive to open programs.,Can you use just one hard drive to store a backup disk image and restore for multiple computers?,can not install Mcafee due to Java script error,,Can Word's track changes comments print in the outside border?,cannot install old software program because computer missing indeo codec driver

No comments:

Post a Comment