Vba copy and print

Contributor

Hi all

Can someone hepl me with this one 

I have this 

 

 

Sub CheckIfCellContainsValue()
Sheet4.Unprotect Password:="245"
Dim index As Integer, NumberOfRows As Integer, ActualCellValue As Variant
NumberOfRows = Range("L14:L250").Rows.Count
For index = 14 To NumberOfRows + 12
ActualCellValue = Range("L" & index).Value
Debug.Print ActualCellValue
If IsEmpty(ActualCellValue) Then
' Do nothing
Else
Range("L12").Value = ActualCellValue
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
End If
Set ActualCellValue = Nothing
Next
Sheet4.Protect Password:="245"
End Sub

 

and it works fin 
but i would like to check cell Z15 and if its 1 do as normal but if the cell contains 2 then copy and pays to sheet 2 and print out 

 

 

1 Reply
Hi @Rajesh-S maybe you know how to get this working
Thanks