Hallo Dustin,
nach deinem Bild einfach und geschmacklos so
Sub Test()
Dim TextBo As Object
Dim Zeile As Long
Dim Spalte As Long
Spalte = 0
Zeile = 0
For Each TextBo In Sheets("Tabelle1").TextBoxes
Zeile = Zeile + 1
If Left(TextBo.Text, 3) = "Pro" Then
Zeile = 1
Spalte = Spalte + 1
End If
Sheets("Tabelle1").Cells(Zeile, Spalte).Value = TextBo.Text
Next TextBo
End Sub
ABER
Wenn ich auf der "Magnettafel" Autos oder Personen vertausche,
dann ändert dass nicht das Ergebnis, die Schleife wird immer gleich
abgearbeitet.
ERGO
Jedes Objekt (TextBo) hat eine Eigenschaft TopLeftCell
Debug.Print TextBo.Text, TextBo.TopLeftCell.Address, TextBo.TopLeftCell.Column, TextBo.TopLeftCell.Row
Mit diesen Informationen kann ich ein Makro mit gezielter Ausgabenfolge schreiben!
|