Hello
I want to change value of cell M2 while printing by print button change value only in cell M2
as Original , Duplicate, Triplicate i tried this code but error is coming please help on this
thanks
Mod Edit: Code Tags Added.
I want to change value of cell M2 while printing by print button change value only in cell M2
as Original , Duplicate, Triplicate i tried this code but error is coming please help on this
thanks
Code:
Sub Button1_Click()
Dim n As Long
n = Application.InputBox("Number of printed copies.?", "Printed Copies", 1, Type:=1)
If n <= 0 Then Exit Sub ' User canceled
With ActiveSheet.PageSetup
.Sheets("Sheet1").Range("M2") = "Original"
ActiveSheet.PrintOut
If n > 1 Then
.Sheets("Sheet1").Range("M2") = "Duplicate"
ActiveSheet.PrintOut
End If
If n > 2 Then
.Sheets("Sheet1").Range("M2") = "Triplicate"
ActiveSheet.PrintOut
End If
End With
End Sub
Mod Edit: Code Tags Added.
Last edited by a moderator: