How do I make a copy of a shape and place it in the same spot

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,375
Office Version
  1. 365
  2. 2016
Platform
  1. 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
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I just found this thread where I originally asked this question and got the code that I am having trouble with.

I started a new thread asking for help with a problem that I didn't realise was related to the code you gave me. Further on in that thread, it became apparent it was relating to this thread but I had already started the new thread. I was reading another thread I had with Michael M and he said I should ask the question in the original thread where I got the answer, so I went searching for this thread. I didn't want to double up on questions on this forum so here is the link to the extra thread I started. Could you help me with the problem I am having on this thread please?


Thanks
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,975
Messages
6,175,749
Members
452,667
Latest member
vanessavalentino83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top