Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
NOOB: Can someone write me some code?
I need a code that will prevent printing or saving nless all fields
are filled in. Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can someone write me some code?
All what fields? Cells on a spreadsheet (if so, which ones)? TextBoxes on a
UserForm (how many)? Something else (describe what)? -- Rick (MVP - Excel) wrote in message ... I need a code that will prevent printing or saving nless all fields are filled in. Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
NOOB: Can someone write me some code?
Hi,
You need to add the code to the Workbook_BeforePrint event and the Workbook_BeforeSave event. The interior code would be the same: IF Range("A1")="" then msgbox "Data is missing from cell A1." Cancel=True end if You would need to add this for all the ranges that might be missing data, if those ranges are contigious, for example A1:A100 then For Each cell in Range("A1:A100") If cell="" Then Beep MsgBox "whatever message you want here." Cancel=True Exit For End if Next cell -- Thanks, Shane Devenshire " wrote: I need a code that will prevent printing or saving nless all fields are filled in. Thanks! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
NOOB: Can someone write me some code?
use the follow events,add some judge codes
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) End Sub Private Sub Workbook_BeforePrint(Cancel As Boolean) End Sub 写入消息 ... I need a code that will prevent printing or saving nless all fields are filled in. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Write VB6 code to be used with VBA | Excel Programming | |||
Write Code w/VBA | Excel Programming | |||
Write code to Write Code | Excel Programming | |||
Code to write out all lines of code | Excel Programming | |||
How can i write TSR code | Excel Programming |