VBAMePlease
Board Regular
- Joined
- Jun 19, 2017
- Messages
- 59
Code:
Private Sub CommandButton3_Click()
Set lookup_rng = Range("AO22:AR20")
Application.ScreenUpdating = False
For Each Cell In lookup_rng
If Cell.Value = Range("J20" & "J22").Value Then
Range("J23:M24").Copy
Cell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("J26:M30").Copy
Cell.Offset(3, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End If
Next Cell
Application.ScreenUpdating = True
End Sub
Any idea why this won't work and is giving me a run-time error?