Hi, Firstly apologies if I post incorrectly, I have no idea how to code.
I have a workbook that has a front summary sheet and a detail sheet. The front sheet shows important data from the detail sheet.
The code below is that when I click the 'click to add part' button, it will copy and paste row 10 to row 11, and also add a new sheet called (2).
If I then click the button again it will add sheet (3) and so on.
1st question - how do I get the copied row on summary sheet to update to the new sheet. Eg cell A10='(1)'!$D$3, how can I get A11 to change to A11='(2)'!$D$3 when I copy and paste it? I need to do this to all cells in the row.
2nd question - if I click the button again how can I get the row to copy and paste incrementally. Currently it inserts to row 11, how can I get the next one to copy to row 12 and also update the new rows to link to sheet (3)?
Hope this makes some sense, any help or point to threads that previously answer similar greatly appreciated. I have searched for answers but can't find anything I can get to work.
I have a workbook that has a front summary sheet and a detail sheet. The front sheet shows important data from the detail sheet.
The code below is that when I click the 'click to add part' button, it will copy and paste row 10 to row 11, and also add a new sheet called (2).
If I then click the button again it will add sheet (3) and so on.
1st question - how do I get the copied row on summary sheet to update to the new sheet. Eg cell A10='(1)'!$D$3, how can I get A11 to change to A11='(2)'!$D$3 when I copy and paste it? I need to do this to all cells in the row.
2nd question - if I click the button again how can I get the row to copy and paste incrementally. Currently it inserts to row 11, how can I get the next one to copy to row 12 and also update the new rows to link to sheet (3)?
VBA Code:
Sub Sample()
Application.CutCopyMode = False
With Worksheets("SUMMARY")
.Rows(10).Copy
.Rows(11).Insert Shift:=xlShiftDown
End With
Application.CutCopyMode = True
Dim test As Worksheet
Sheets(2).Copy After:=Sheets(Sheets.Count)
Set test = Sheets(Sheets.Count)
test.Name = "copied sheet!"
End Sub
Hope this makes some sense, any help or point to threads that previously answer similar greatly appreciated. I have searched for answers but can't find anything I can get to work.