dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,375
- Office Version
- 365
- 2016
- Platform
- Windows
I have code that moves some command buttons further down a spreadsheet as the rows in it are copied below. This means the buttons are now below the second copy of the rows. The only problem is that I want a divider (textbox4) to remain between the 2 copies of the rows. This code moves the command buttons to the right spot and I also need textbox4 moved in the same proportion but I need to leave a copy of it where it currently is. Can someone help me with the vba code please?
VBA Code:
Sub AddRows()
Dim Total As Range
With ThisWorkbook.Worksheets("ACA_Quoting")
'.Range("29:31").EntireRow.Insert
'.Rows(29).Insert Shift:=xlShiftDown 'Inserts a row below the current table to create a buffer zone between the 2 tables.
.Range("F29:H32").Copy .Range("F51")
.Range("A8:I28").Copy .Range("A38") 'Pastes a copy of the table below current table between the bottom of the table and the totals
'.Range("F30:H32").Offset(2, 0).Select 'This is the range of the totals that need to be moved down so the additional table can be pasted in
'.Range("C7").Insert Shift:=xlDown
.Shapes.Range(Array("cmdAddRatio")).Select
.Shapes("cmdAddRatio").IncrementTop 505
.Shapes.Range(Array("cmdGsign")).Select
.Shapes("cmdGsign").IncrementTop 505
.Shapes.Range(Array("cmdNoSign")).Select
.Shapes("cmdNoSign").IncrementTop 505
.Shapes.Range(Array("cmdSaveToPdf")).Select
.Shapes("cmdSaveToPdf").IncrementTop 505
.Shapes.Range(Array("cmdCustomSign")).Select
.Shapes("cmdCustomSign").IncrementTop 505
.Shapes.Range(Array("textbox4")).Select
.Shapes("textbox4").IncrementTop 505
'.Range("29:31").EntireRow.Insert
End With
End Sub