Link to home
Start Free TrialLog in
Avatar of Elania Rodriguez
Elania Rodriguez

asked on

Create a macro to print two copies changing a data validation list on 2nd copy

I want to create a macro that will print two copies of a worksheet.
The first print will be the "white copy" I'm using a data validation list to select White Copy, and the second print will be the "yellow copy" which is the other option in the list. When I record the macro and make the selection it does not recognize the selection change in the list. How do I get it to recognize the selection and print according to it?

I got it to work, but it is now giving me a runtime error 1004
Here is what I'm using"

Sub Printer()
'
' Printer Macro
'

'
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
        IgnorePrintAreas:=False
     Range("I5:K5").Value = Split(Range("I5").Validation.Formula1, ",")(1)
   
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
        IgnorePrintAreas:=False
     Range("I5:k5").Value = Range(Range("I5:k5").Validation.Formula1)(2)
End Sub

Can you tell me what I'm doing wrong?
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Elania Rodriguez
Elania Rodriguez

ASKER

Run-time error '9';
Subscript out of range

It did work but with an error
Could you send a dummy?
A solution according to author's comment