06.03.2018, 16:59
Hallo Forum,
ich gebe Zahlen über eine Userform in ein Tabellenblattein. Es funktioniert alles prima nur soll nun die erste Zahl in Spalte "A", Zeile "4", die zweite Zahl in Spalte "BE",Zeile"5" eingegeben werden. Die nächste Zahl wieder in Spalte "A6" dann Spalte "BE7" (SpalteBE=Spalte57) usw. Den nachstehenden Code habe ich von Eurem VorgängerForum. Im Voraus schon mal Vielen Dank.
Viele Grüsse Empo
Private Sub CommandButton12_Click()
Dim loLetzte As Long
Dim wsTabelle As Worksheet
If TextBox1 <> "" Then
If CInt(TextBox1) > 100 Then
MsgBox "Maximalwert ist 100"
Else
For Each wsTabelle In Worksheets
With wsTabelle
Select Case .Name
Case "Equi geteilt“
loLetzte = IIf(IsEmpty(.Cells(.Rows.Count, 1)), .Cells(.Rows.Count, 1).End(xlUp).Row, .Rows.Count) + 1
If loLetzte < 4 Then loLetzte = 4
.Cells(loLetzte, 1) = CInt(TextBox1)
End If
End Select
End With
Next wsTabelle
TextBox1 = ""
End If
Else
MsgBox "Keine Werte vorhanden"
End If
End Sub
ich gebe Zahlen über eine Userform in ein Tabellenblattein. Es funktioniert alles prima nur soll nun die erste Zahl in Spalte "A", Zeile "4", die zweite Zahl in Spalte "BE",Zeile"5" eingegeben werden. Die nächste Zahl wieder in Spalte "A6" dann Spalte "BE7" (SpalteBE=Spalte57) usw. Den nachstehenden Code habe ich von Eurem VorgängerForum. Im Voraus schon mal Vielen Dank.
Viele Grüsse Empo
Private Sub CommandButton12_Click()
Dim loLetzte As Long
Dim wsTabelle As Worksheet
If TextBox1 <> "" Then
If CInt(TextBox1) > 100 Then
MsgBox "Maximalwert ist 100"
Else
For Each wsTabelle In Worksheets
With wsTabelle
Select Case .Name
Case "Equi geteilt“
loLetzte = IIf(IsEmpty(.Cells(.Rows.Count, 1)), .Cells(.Rows.Count, 1).End(xlUp).Row, .Rows.Count) + 1
If loLetzte < 4 Then loLetzte = 4
.Cells(loLetzte, 1) = CInt(TextBox1)
End If
End Select
End With
Next wsTabelle
TextBox1 = ""
End If
Else
MsgBox "Keine Werte vorhanden"
End If
End Sub