Printing two sheets simulataneously

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Printing two sheets simulataneously

Post by adam »

Hi anyone,

I’m trying figure out a standard module macro code that would first;

Copy the cell value of “O6” from the active sheet and paste in “previous” sheet’s cell value O6 if the cell “M10” contains any text other than the text “Other”.
And then print the active sheet.
Call the macro Sub SaveConsReceipt()
And then print the sheet “previous”
Clear the cell value O6 from the sheet “previous”

Any help on this would be kindly appreciated.

Thanks in advance.
Best Regards,
Adam

User avatar
HansV
Administrator
Posts: 78513
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Printing two sheets simulataneously

Post by HansV »

Code: Select all

Sub Print2()
  Dim n As Long
  n = ActiveSheet.Index
  If n = 1 Then
    MsgBox "This is the first sheet!", vbExclamation
    Exit Sub
  End If
  If ActiveSheet.Range("M10") <> "Other" Then
    ActiveSheet.Previous.Range("O6") = ActiveSheet.Range("O6")
  End If
  ActiveSheet.PrintOut
  Call SaveConsReceipt
  ActiveSheet.Previous.PrintOut
  ActiveSheet.Previous.Range("O6").ClearContents
End Sub
Best wishes,
Hans

User avatar
adam
SilverLounger
Posts: 2347
Joined: 23 Feb 2010, 12:07

Re: Printing two sheets simulataneously

Post by adam »

Thanks for the help Hans. I do really appreciate it.
Best Regards,
Adam