Betrifft: Textbox als Variable ansprechen?
von: Anja
Private Sub Hinrunde_Click()
Dim z, x As Integer
Dim Zieltab As Worksheet
Dim Gewichtsarray(5) As String
Dim Zähler As Integer
Set Zieltab = ActiveWorkbook.Worksheets("Kampfreihenfolge Frauen")
Gewichtsarray(0) = "-52"
Gewichtsarray(1) = "-57"
Gewichtsarray(2) = "-63"
Gewichtsarray(3) = "-70"
Gewichtsarray(4) = "+70"
Zähler = 0
For x = 2 To 6
If Zieltab.Cells(x, 2).Value = Gewichtsarray(Zähler) Then
Zieltab.Cells(x, 1).Value = TextBox72.Value
End If
Next x
Zähler = Zähler + 1
x = 1
For x = 2 To 6
If Zieltab.Cells(x, 2).Value = Gewichtsarray(Zähler) Then
Zieltab.Cells(x, 1).Value = TextBox73.Value
End If
Next x
Zähler = Zähler + 1
x = 1
For x = 2 To 6
If Zieltab.Cells(x, 2).Value = Gewichtsarray(Zähler) Then
Zieltab.Cells(x, 1).Value = TextBox74.Value
End If
Next x
Zähler = Zähler + 1
x = 1
For x = 2 To 6
If Zieltab.Cells(x, 2).Value = Gewichtsarray(Zähler) Then
Zieltab.Cells(x, 1).Value = TextBox75.Value
End If
Next x
Zähler = Zähler + 1
x = 1
For x = 2 To 6
If Zieltab.Cells(x, 2).Value = Gewichtsarray(Zähler) Then
Zieltab.Cells(x, 1).Value = TextBox76.Value
End If
Next x
End Sub
Betrifft: AW: Textbox als Variable ansprechen?
von: 1713320.html
Geschrieben am: 16.09.2019 14:50:19
Hi
kommt darauf an.
in einer Userform kannst du Steuerelemente über die Funktion Controls("SteuerelementName") ansprechen:
...Value = Me.Controls("TextBox" & x).Text
mit ActiveX-Controls auf dem Tabellenblatt geht das so nicht.
Betrifft: AW: Textbox als Variable ansprechen?
von: 1713330.html
Private Sub Hinrunde_Click()
Dim z, x As Integer
Dim Zieltab As Worksheet
Dim Gewichtsarray(5) As String
Dim Zähler As Integer
Set Zieltab = ActiveWorkbook.Worksheets("Kampfreihenfolge Frauen")
Gewichtsarray(0) = "-52"
Gewichtsarray(1) = "-57"
Gewichtsarray(2) = "-63"
Gewichtsarray(3) = "-70"
Gewichtsarray(4) = "+70"
For Zähler = 0 To 4
For x = 2 To 6
If Zieltab.Cells(x, 2).Value = Gewichtsarray(Zähler) Then
Zieltab.Cells(x, 1).Value = _
Me.Shapes("Textbox" & Format(72 + Zähler, "0")).OLEFormat.Object.Object.Value ' _
bei Active-X-Textbox
Zieltab.Cells(x, 1).Value = Me.Controls("Textbox" & Format(72 + Zähler, "0")).Value _
'bei Userform-Textbox
End If
Next x
x = 1
Next Zähler
End Sub
Betrifft: AW: Textbox als Variable ansprechen?
von: 1713337.html
Geschrieben am: 16.09.2019 15:51:25
Hallo Franz,
vielen lieben Dank. Hat super funktioniert!
Anja
Betrifft: AW: Textbox als Variable ansprechen?
von: 1713338.html