I know this is odd to comment on a solved problem Create command button to copy range and paste in another wrk sheet but I have a similar problem. So I can't help myself.
I have been using the below code
but now I have to change the destination worksheet every time to paste the copied data.
If it is possible that the source worksheet cell A1 has the destination worksheet name( "MS" or any other worksheet). when I click on the button it copied data and paste it to the destination sheet based on the cell A1 of the source file named "All Data".
Hope someone helps me to resolve my problem.
Thanks in advance.
I have been using the below code
VBA Code:
Sub Button1_Click()
Dim i As Integer, LastRow As Long
i = InputBox("Please enter the row number to copy", "Select Row", "8 - 1250")
Sheets("All Data").Range(Cells(i, 3), Cells(i, 6)).Copy
Sheets("MS").Select
LastRow = Sheets("MS").Cells(Rows.Count, "C").End(xlUp).Row
Cells(LastRow + 1, 2).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
If it is possible that the source worksheet cell A1 has the destination worksheet name( "MS" or any other worksheet). when I click on the button it copied data and paste it to the destination sheet based on the cell A1 of the source file named "All Data".
Hope someone helps me to resolve my problem.
Thanks in advance.