Hi,
Sorry if I'm asking a super easy question. From sheet Details I need to copy next rows each time I click like for example - A5,B5,C5 to the next empty row in destination sheet. From Invoice I want to copy fixed rows in next avilable rows in the destination sheet. Below is the code that I have however it copies the fixed rows from Details sheet. Also it should paste values instead of formulae. Please help with this one.
Sorry if I'm asking a super easy question. From sheet Details I need to copy next rows each time I click like for example - A5,B5,C5 to the next empty row in destination sheet. From Invoice I want to copy fixed rows in next avilable rows in the destination sheet. Below is the code that I have however it copies the fixed rows from Details sheet. Also it should paste values instead of formulae. Please help with this one.
Code:
Private Sub CommandButton1_Click()Application.ScreenUpdating = False
Dim ws1 As Worksheet, ws2 As Worksheet, ws3 As Worksheet
Dim DestRow As Long
Set ws1 = Sheets("Details")
Set ws2 = Sheets("Inv")
Set ws3 = Sheets("Reg")
DestRow = ws3.Cells(Rows.Count, "A").End(xlUp).Row + 1
ws1.Range("A4").copy ws3.Range("A" & DestRow)
ws1.Range("B4").copy ws3.Range("D" & DestRow)
ws1.Range("C4").copy ws3.Range("G" & DestRow)
ws2.Range("B13").copy ws3.Range("N" & DestRow)
ws2.Range("H13").copy ws3.Range("L" & DestRow)
ws2.Range("I28").copy ws3.Range("J" & DestRow)
ws2.Range("H15").copy ws3.Range("K" & DestRow)
Application.ScreenUpdating = True
End Sub
Comment