Hi,
Thanks for looking.
Have been puzzling over this for an hour now but cannot piece in the missing part to the below.
All I want to do is...
- Define a range starting in cell A3
- Compare the value in column A with cell Q2, greater than or equal to and compare to cell S2 less than or equal to
- If it meets the criteria then take the cell value and paste it to cell U2 to then print out another sheet which will reference this value
Code I have so far is...
Thanks in advance for any assistance
Steven
PS values will always be numeric starting at 1
Thanks for looking.
Have been puzzling over this for an hour now but cannot piece in the missing part to the below.
All I want to do is...
- Define a range starting in cell A3
- Compare the value in column A with cell Q2, greater than or equal to and compare to cell S2 less than or equal to
- If it meets the criteria then take the cell value and paste it to cell U2 to then print out another sheet which will reference this value
Code I have so far is...
Code:
Sub PrintDriverReturns()
Dim lRow As Long
With ActiveSheet
lRow = .Cells(.Rows.Count, "B").End(xlUp).Row
End With
For Each i In Range("A3:A" & lRow)
If Cells(i, "A").Value <= Range("Q2").Value And Cells(i, "A").Value >= Range("S2").Value Then
Cells(i + 2, "A").Select
Cells(i + 2, "A").Copy
Range("U2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Worksheets("Forms - Driver Returns").Select
ActiveSheet.PrintPreview
Worksheets("Found in Driver Returns").Select
Else
End If
Next
End Sub
Thanks in advance for any assistance
Steven
PS values will always be numeric starting at 1