P
puiuluipui
Hi, i need this code to copy rows, but only from A to J (A:J).
Sub copy3()
Dim lastRow As Long
Dim MySheet As String
MySheet = Sheets("Sheet1").Range("M1").Value
lastRow = Worksheets(MySheet).Cells(Worksheets(MySheet).Rows.Count,
"A").End(xlUp).Row
Worksheets("Sheet1").UsedRange.Copy
Worksheets(MySheet).Activate
Range("A" & (lastRow + 1)).Select
ActiveSheet.Paste
Worksheets(MySheet).Range("A" & (lastRow + 1)).PasteSpecial
Application.CutCopyMode = False
Sheets("Sheet1").Activate
Range("A1").Select
End Sub
Can this be done?
Thanks!
Sub copy3()
Dim lastRow As Long
Dim MySheet As String
MySheet = Sheets("Sheet1").Range("M1").Value
lastRow = Worksheets(MySheet).Cells(Worksheets(MySheet).Rows.Count,
"A").End(xlUp).Row
Worksheets("Sheet1").UsedRange.Copy
Worksheets(MySheet).Activate
Range("A" & (lastRow + 1)).Select
ActiveSheet.Paste
Worksheets(MySheet).Range("A" & (lastRow + 1)).PasteSpecial
Application.CutCopyMode = False
Sheets("Sheet1").Activate
Range("A1").Select
End Sub
Can this be done?
Thanks!