Hello everyone
I'm trying to copy range("A:F") of the active cell row in Data sheet to Result sheet in the last row
I don't want to use copy method ..
I tried the following method but no results .. I mean no data copied to Result sheet
Sub CopyRowActiveCell()
Dim WS As Worksheet, SH As Worksheet, LR As Long
Set WS = Sheets("Data"): Set SH = Sheets("Result")
LR = SH.Cells(Rows.Count, 1).End(xlUp).Row + 1
SH.Cells(LR, 1).Resize(1, 6).Select
SH.Cells(LR, 1).Resize(1, 6) = WS.Cells(ActiveCell.Row, 1).Resize(1, 6)
End Sub
Any idea about that ..
It works with one cell ...Am I oliged to loop through columns of the active cell
For I = 1 to 6
.......
Next I
This worked
Sub CopyRowActiveCell()
Dim WS As Worksheet, SH As Worksheet
Dim lrWS As Long, lrSH As Long, I As Long
Set WS = Sheets("Data"): Set SH = Sheets("Result")
lrWS = ActiveCell.Row
lrSH = SH.Cells(Rows.Count, 1).End(xlUp).Row + 1
For I = 1 To 6
SH.Cells(lrSH, I) = WS.Cells(lrWS, I)
Next I
End Sub
But I'm searching for method avoiding copy method and avoiding loop method
Bookmarks