Hope all are fine. There is something that turning my head down. Please.
I have work sheet which have all the data.
I need to copy data from one sheet to another. I am using a command button to copy specific row to another sheet. The code is below.
- 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
- LastRow = Sheets("MS").Cells(Rows.Count, "C").End(xlUp).Row
- Cells(LastRow + 1, 2).Select
- Application.CutCopyMode = False
- End Sub
but every time I need to change the destination sheet in the code to paste data to various sheet.
It would be easy that I typed the sheet name in the source sheet "All Data" in G2 cell in which the copied data will be pasted.
When I click on the command button it copied data as above code and pasted data to the sheet specified on cell "G2" of the source sheet.
Hope some one understand my thoughts. If its possible then what should I change in the above code.
Thanks in advance.