How to copy and insert shapes with increase in series of text inside of shape ie 1,2,3 or A,B,C by offsetting 2 columns after each increase in series?

Pramodpandit123

New Member
Joined
Apr 18, 2020
Messages
30
Office Version
  1. 2016
Platform
  1. Windows
I need shapes to be copied and increased just like in picture.I tried Using Addshapes but it is not the right way to do it i think.How can i just copy and insert shapes with increase in its series.I tried copy and pasting range but the shapes did not copy.Following is a code i did using Addshapes.Also can anyone tell how to exactly find the Left,top value from {AddShape(msoShapeOval, iLeft, iTop, iWidth, iheight)} or its just Hit and trial ?
VBA Code:
Option Explicit

Private Sub Click()


    Dim i, iLeft, iTop, iWidth, iheight As Integer
    Dim c, j As Range
    Set j = Range("A4")
    Set c = Range("D7:D8")
    iLeft = c.Left + (c.Width / 4)
    iTop = c.Top
    iWidth = c.Width / 2
    iheight = c.Height
   
    For i = 1 To j
        
            Dim ovalShape As Shape
            Set ovalShape = Sheet1.Shapes.AddShape(msoShapeOval, iLeft, iTop, iWidth, iheight)
            
            With ovalShape
                ovalShape.ShapeStyle = msoLineStylePreset7
                ovalShape.TextFrame.Characters.Text = i   ' ADD TEXT TO THE SHAPES.
            End With

            iLeft = iLeft + 145
             
        DoEvents
    Next
End Sub
 

Attachments

  • Capture.JPG
    Capture.JPG
    22 KB · Views: 6
Re: "If you have posted the question at more places, please provide links to those as well."
Apparently it is not worth his time to do so.
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,996
Messages
6,122,636
Members
449,092
Latest member
bsb1122

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