WebJul 31, 2015 · then you can access individual shapes by. Dim li As Long. Dim oshp As Shape. Set oshp = reference to a grouped shape. For li = 1 To oshp.GroupItems.count. ' you can … WebMay 12, 2014 · so you can assign that to a variable with a name you will recognize as belonging to that shape, for instance (assuming the shape is on Sheet2)... Set FirstOvalOnSheet2 = Sheet2.Shapes (Sheet2.Shapes.Count) or you can store its name in a String variable that you would also associate with that shape, for instance...
Selecting a shape in VBA without knowing the name of the shape
WebJul 28, 2024 · Once you select your shape, you should see the name of the shape in the Name Box, which is located on the far left side of the formula bar. If you don't see it, … WebOct 22, 2014 · Determining the name of a shape that is selected by the user. Determining the text of a shape that was clicked-on to run a VBA macro. In both scenarios, the code will set a shape variable to the active shape so … penny shipping stocks
Naming an Object in Excel VBA so it can be selected once ... - Super User
WebFeb 19, 2016 · You could use the loop above to find the last Picture #, and then you'd know that the next one pasted would be #+1 and could change the name as required, using ActiveSheet.Shapes.Range (Array ("Picture #+1")).Name. You can also use .Top and .Left to move the image around as needed, as well as .Height and .Width if you need to resize it. … WebOct 13, 2024 · Below are few examples: ActiveSheet.OptionButtons ("Option Button 1").Select ActiveSheet.Shapes ("Option Button 1").ControlFormat.Value = Xlon Range ("A1")=Activesheet.OptionButtons ("Option Button 1").value ActiveSheet.OptionButtons ("Option Button 1").LinkedCell = "Sheet1!$A$1" or Use this sample code for getting the shape selected: Sub FindTheShape() Dim sht as Worksheet Set sht = ThisWorkbook.Worksheets("Fleet 1") Dim sObject as shape For Each sObject in ActiveSheet.Shapes If sObject.Name = "MyRectangle" then sObject.Select End If Next End Sub penny shoe shine spray