";s:4:"text";s:3500:" Set oshp = reference to a grouped shape.
In deinem Fall könntest du alle Shapes selektieren, die sich links von einer bestimmten Spalte befinden. Damit Du den letzten erhältst, gib als Index einfach Shapes.Count, also die Anzahl der Shapes an. Dim li As Long Dim oshp As Shape. Frage: Kann ich eine Makroprozedur schreiben und dieser die ID/den Namen des Shapes übergeben, oder aber in dieser Prozedur das angeklickte Shape ermitteln? Nachfolgender Programmcode stellt diese Möglichkeit zur Verfügung. 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 you can then do as you please from there. [VBA]Sub Not_ID() Dim oshp As Shape ' this is an object variable Set oshp = ActiveWindow.Selection.ShapeRange(1) ' note you must use "Set" 'give this shape a unique name. Danke schon … The advantage of the above approach is that you can now refer to the shape that's been added either by the object variable used: 'can then refer to this by variable now ... sq.Left = 200. Workaround wäre für jedes Shape ne eigene Prozedur zu schreiben (sehr unschön). What Vba would I use so that when a user clicks on a shape, it will show a messagebox stating the shapes name. Mittels VBA können Objekte / Shapes im Powerpoint benannt oder umbenannt werden, indem die Name-Eigenschaft des Shapes geändert wird. then you can access individual shapes by. sq.Name = "WOL_0001" End Sub. Nur will ich jetzt net dass genau dieses eine formatiert wird, sonder auch wenn ich ein neues Zeichne und dieses mit anklick auch dieses formatiert wird. VBA - Shapes per VBA ansprechen. You don't need to use ID at all just use an object variable to refer to the selected shape would be one way. For li = 1 To oshp.GroupItems.count ' you can add some code here for finding a paticular shape based on certain properties oshp.GroupItems(li).Select Next Dein Ansatz, set Range(„A1“)= Active.Shapes.name klappt leider nich… funktioniert nicht, weil Shapes alle Shapes darstellt, Du musst einen Index angeben, etwa Shapes(1).name. Programmcode 'Prozedur zum umbenennen eines Shapes / Objekts Sub Objekte_benennen(ByVal Objekt As Shape) 'benennt das übergebene Shape um Dim alter_Name As String Dim neuer_Name … Leider bin ich über Suchen noch nicht erfolgreich gewesen (liegt wohl daran, dass ich noch nicht die richtigen Begriffe gefunden habe). Hab ein Makro aufgezeichnet, bei dem ich bei einem Viereck die Größe verändert hab. You are confusing ID (line 1) with Index or ZOrder (line 2) They are quite different. Shape Selected By User Note that (as always in VBA) if you're capturing a reference to something, you need to include brackets round the argument list. Betrifft: AW: Shapes in VBA ansprechen, umbenennen von: fcs Geschrieben am: 21.09.2013 15:40:28 Hallo Felix, du kannst die Shapes über den Namen ansprechen. Range(„A1“) = ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Name. I would like 1 macro to work with every shape, so if I had a million shapes, I could assign this 1 single macro to all the shapes. Der … I noticed when a user clicks on the shape the shape is not selected so I can't use selection.name. Hey, ich möchte mir ein Button machen, wo alle angeklickten Shapes (Quatrate oder so) formatiert werden. Es geht aber auch über die Zelle in der sich die linke obere Ecke des Shapes befindet.