excel shape never moves

BKChedlia

New Member
Joined
Jun 15, 2016
Messages
41
Hi, I want to edit an add-in, by adding some shapes (Group) to exsiting one in the same sheet(15 groups they move from a position to another dynamically via the add-in), when I add group 16 manually to the sheet, and I run the macro it never moves but group3 moves instead of him the other groups goes to their right places.
here's the picture :
https://drive.google.com/file/d/0B6nhIMB-ueBhXzA3S1VnVlB6dlE/view?usp=sharing
and the macro :

Code:
 For i = 1 To 16        Sheets(xInvS).Select
        'name = "(ID:" + CStr(Cells(i + 2, 1).Value) + ")  " + CStr(Cells(i + 2, 2).Value)
        name = Cells(i + 2, 2).Value
        impact = Cells(i + 2, 4).Value
        prob = Cells(i + 2, 5).Value




        Sheets(xRiS).Select
        ActiveSheet.Shapes("Group " & i).Select
        Selection.ShapeRange.IncrementTop (-100 * (impact - 1))
        Selection.ShapeRange.IncrementLeft (100 * (prob - 1))


        ReDim Preserve tempCount(i)
        tempCount(i - 1) = Len(temp) + 1
        
        temp = temp & xRisk & " #" & i & ":   " & name & Chr(10)




   Next i


    Set txtShape = ActiveSheet.Shapes("Text Box 11")
    txtShape.DrawingObject.Text = temp
    txtShape.DrawingObject.Font.Size = 10
    txtShape.DrawingObject.Font.name = "Georgia"
    ActiveSheet.Shapes.Range(Array("Text Box 11")).Select
    Selection.ShapeRange.IncrementTop 47


    txtShape.DrawingObject.Characters(Start:=1, Length:=Len(xMajRi)).Font.Size = 12


    For i = 0 To 15
        txtShape.DrawingObject.Characters(Start:=tempCount(i), Length:=xLength).Font.FontStyle = "Bold"
    Next i


ActiveSheet.PageSetup.PrintArea = "$A$1:$M$16"
    ActiveSheet.PageSetup.FitToPagesWide = 1
    ActiveSheet.PageSetup.Orientation = xlPortrait
Range("A1").Select
 
Last edited:

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,213,538
Messages
6,114,218
Members
448,554
Latest member
Gleisner2

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