PDA

View Full Version : Excel VBE Help Needed



bigbenfan
10-05-2006, 01:39 PM
I am trying to write a macro or a code that will print an Excel spreadsheet. :banghead: Please help me. Thank you!:ipray:

johnske
10-05-2006, 01:45 PM
Hi bigbenfan, welcome to VBAX. Your VBA Help files provide help with this if you know where to look - look under PrintOut. Basic example... Sub PrintSheet()
ActiveSheet.PrintOut
End Sub :)

Charlize
10-05-2006, 01:47 PM
If you mean the active sheet, the one which is visible when you push a button, try this :
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Put it in a sub in a module.

Charlize

mdmackillop
10-05-2006, 01:52 PM
For something like this, use the macro recorder.

Sub Macro1()
'
' Macro2 Macro
' Macro recorded 05/10/2006 by User
'
'
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

End Sub

You can check the help file as suggested by Johnske for more information on the terms used.