+ Reply to Thread
Results 1 to 5 of 5

Printing another sheet

  1. #1
    Registered User
    Join Date
    08-28-2006
    Posts
    6

    Printing another sheet

    I would like to put a macro in sheet1 which prints sheet2 when run. Preferably through a button. Could this be possible? How?
    Thanks in advance.

  2. #2
    Forum Contributor
    Join Date
    09-04-2006
    Location
    Yorkshire, England
    Posts
    267

    Print

    Hi


    So you want to print sheet 2 from a button in sheet1?

    If so

    Just record a macro from sheet1 of what you want i.e printing / print settings etc:

    To start a macro
    Tools > Macro > Record New Macro...
    then to stop
    Tools > Macro > Stop Recording...

    When you are done just use the autoshapes function to draw a button.
    Right click on the auto shape and there should be a function to assign a macro to it. Assign your recorded macro to it and you are done.

    If you just want to print without chnaging the sheet it should look like the below:

    Sub printsheet2()
    '
    ' printsheet2 Macro
    ' Macro recorded (Date) by (User)
    '

    '
    Sheets("Sheet2").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    End Sub

    Hope it helps
    JR
    Versions
    Mac OS X 'Leopard'
    Mac MS Office Excel 2004
    Windows XP
    MS Excel 2002
    MS Excel 2003

  3. #3
    Registered User
    Join Date
    08-28-2006
    Posts
    6
    Thanks. But, I forgot to mention that sheet 2 is hidden. I tried to do the recording of macro to print the hidden sheet 2, but it doesn't work. Is there any other way around this?

  4. #4
    Forum Contributor
    Join Date
    09-04-2006
    Location
    Yorkshire, England
    Posts
    267
    Hi


    Put theis in your macro as the only way i know around it is to hide and unhide the sheet in your code

    Sheets("Sheet2").Visible = True
    Sheets("Sheet2").Visible = False

    so your code should look something like this

    Sub printsheet2()

    Sheets("Sheet1").Select
    Sheets("Sheet2").Visible = True
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Sheets("Sheet2").Visible = False
    Range("F11:F12").Select
    Range("F12").Activate
    Sheets("Sheet1").Select
    Range("E19").Select
    End Sub

    hope it helps

  5. #5
    Registered User
    Join Date
    08-28-2006
    Posts
    6
    Thanks JR.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1