#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default excel: no blank

Hi,
I am looking for a macro before print to verify if specify cell is filled
with values..
Thanks.
George...



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default excel: no blank

Copy the following code into the workbook's code module. To get to the right
place: right-click on the Excel icon to the left of the word "File" in the
Excel menu and choose [View Code] from the popup list. Copy the code below
into it and modify it to use the correct sheet name and cell that needs to
have data in it before it can be printed.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If IsEmpty(Worksheets("Sheet1").Range("A1")) Then
Cancel = True ' cancel printing
'don't print if the cell on the sheet is empty
'could put a message as:
MsgBox "No entry on sheet 'Sheet1', cell A1"
End If
End Sub


"George" wrote:

Hi,
I am looking for a macro before print to verify if specify cell is filled
with values..
Thanks.
George...




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Index/match - make blank cells return a blank value. diaare Excel Worksheet Functions 3 May 3rd 23 03:44 AM
where can I down Blank Worksheets, blank stmt. of account forms carmen Excel Discussion (Misc queries) 2 January 15th 07 03:03 PM
Not showing blank and non blank items in filter mode for values Bhaskar Polisetty Excel Worksheet Functions 0 June 20th 06 02:04 PM
Imported Data creates blank cells that aren't really blank JackieD Excel Worksheet Functions 14 February 23rd 06 12:57 AM
how to get excel to display blank if reference cell blank silent1(not) Excel Worksheet Functions 1 December 2nd 05 02:49 PM


All times are GMT +1. The time now is 04:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"