Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sheet3.PrintOut...Only if sheet2 Cell A1 has data????? 1

Status
Not open for further replies.

coolcarls

Technical User
Jan 19, 2002
182
US
How do I have a sheet printout (via a macro) if a cell in another sheet has data?
I have tried a bunch of stuff but can't get it right.
 
Sub test()

Application.ScreenUpdating = False

Sheets("Sheet2").Activate

Dim checker As Variant

Set checker = range("A1")

If checker <> &quot;&quot; Then

Sheets(&quot;Sheet3&quot;).Select

Application.Dialogs(xlDialogPrint).Show

Application.ActivePrinter = &quot;Set printer name here:&quot;
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
&quot;Set printer name here:&quot;, Collate:=True

End If

Set checker = Nothing

Application.ScreenUpdating = True

End Sub

Not the slickest, but it works.

Sky
 
You're very welcome. I'm new to VBA, so it's nice giving a little back (even though I don't really know what I'm doing).

Glad it worked out.

Sky
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top