AbdulkareemAlhassni
New Member
- Joined
- Nov 16, 2018
- Messages
- 41
Hi guys,
what am i doing wrong here ?
Private Sub CommandButton1_Click99()
Dim LR As Long, i As Long, cls
cls = Array("B2", "D2", "C2")
With Sheets("Sheet2")
LR = WorksheetFunction.Max(2, .Range(Array("H1", "K1", "Z1")))
For i = LBound(cls) To UBound(cls)
Range(cls(i)).Copy Destination:=.Cells(LR, i + 1)
Next i
End With
End Sub
I want to copy from specified cells and paste to specified cells
what am i doing wrong here ?
Private Sub CommandButton1_Click99()
Dim LR As Long, i As Long, cls
cls = Array("B2", "D2", "C2")
With Sheets("Sheet2")
LR = WorksheetFunction.Max(2, .Range(Array("H1", "K1", "Z1")))
For i = LBound(cls) To UBound(cls)
Range(cls(i)).Copy Destination:=.Cells(LR, i + 1)
Next i
End With
End Sub
Code:
Private Sub CommandButton1_Click99()
Dim LR As Long, i As Long, cls
cls = Array("B2", "D2", "C2")
With Sheets("Sheet2")
LR = WorksheetFunction.Max(2, .Range(Array("H1", "K1", "Z1")))
For i = LBound(cls) To UBound(cls)
Range(cls(i)).Copy Destination:=.Cells(LR, i + 1)
Next i
End With
End Sub
I want to copy from specified cells and paste to specified cells