Excel VBA code to print a worksheet, help required

  daba 00:20 28 Sep 2003
Locked

I can't seem to find the the right command syntax to make excel print a worksheet, from a button on another sheet.

I'm using Excel '97, but needs to be transportable to 2000 and beyond...

Any help appreciated.

TIA

  powerless 00:40 28 Sep 2003

I did the last one so i'll let vog do this one ;-))

  VoG II 00:41 28 Sep 2003

ActiveSheet.PrintOut

or Sheets("Sheet9").PrintOut

  VoG II 00:42 28 Sep 2003

What have I missed?

  powerless 00:43 28 Sep 2003

Nothing i was joking.

=C1+C2

Thats the only thing i know :-(

  VoG II 00:44 28 Sep 2003

By the way:

As noted by Simsy in an earlier thread, you can learn a lot by recording a macro.

  tbh72 00:49 28 Sep 2003

Hear Hear to macro recordings and knowledge.... I'm sure Vog will agree, many professional coders use the record feature in order to save time anyhow?!?!?

  VoG II 00:53 28 Sep 2003

I'm not a professional coder but I do a lot of coding in my profession, if that makes sense.

I do record macros then edit them to do exactly what I want. I find this especially useful with operations on charts where there are myriad features that are not well documented if at all.

  daba 01:04 28 Sep 2003

Thanx guys,

but it also highlights the problem with Help Files, sometimes they are just too damn deep, when all you really want is a basic - like my prob.

the excel help on "printing" doesn't go anywhere near the .PrintOut suboption.

take your point on macros though, used the technique loads of times, don't know why i didn't think to try it this time. oh, well.

anyway it was to do with an earlier thread regarding printing lottery draw entry tickets, and I've got the printout sussed, my local tested it today (just the numbers i chose were wrong the actual printout worked fine, even though he fed it in the machine backwards).

now need to work more on the front end, linking into a database perhaps of multiple entries, each 7 producing a slip that will pass through the Camelot machine.

daba

  tbh72 01:10 28 Sep 2003

Hey Daba, I hope your going to share the template you've created..... I've given up on, I can't work in pixels!!!!

  VoG II 01:12 28 Sep 2003

Where was pixels mentioned?

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5T review: Hands-on

Illustrator Andrés Lozano on his improv line work, brazen use of colours & hand sketching

iPhone X review

Comment envoyer gratuitement des gros fichiers ?