25.11.2017, 18:52
Hallo Forum,
ich habe ein kleines Problem. Ich gebe Zahlen in ein Excel Tabellenblatt über eine Userform ein. Die erste Zahl wird in Spalte (1) "A" Zeile "5" eingegeben, die zweite Zahl soll in Spalte (37)"AK"eingegeben werden. Die dritte Zahl wieder in Spalte (1) "A" Zeile "7",die vierte Zahl in Spalte (37)"AK" Zeile "7" usw.
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 "tag"
loLetzte = IIf(IsEmpty(.Cells(.Rows.Count, 1)), .Cells(.Rows.Count, 1).End(xlUp).Row, .Rows.Count) + 2
If loLetzte < 5 Then loLetzte = 5
.Cells(loLetzte, 1) = CInt(TextBox1)
Case "tag geteilt"
loLetzte = IIf(IsEmpty(.Cells(.Rows.Count, 1)), .Cells(.Rows.Count, 1).End(xlUp).Row, .Rows.Count) + 1
If loLetzte < 5 Then loLetzte = 5
.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
Was muß ich änder? Im Voraus schonmal vielen Dank.
Dann meine email adresse gibt es nicht mehr. Wie kann ich sie ändern?
ich habe ein kleines Problem. Ich gebe Zahlen in ein Excel Tabellenblatt über eine Userform ein. Die erste Zahl wird in Spalte (1) "A" Zeile "5" eingegeben, die zweite Zahl soll in Spalte (37)"AK"eingegeben werden. Die dritte Zahl wieder in Spalte (1) "A" Zeile "7",die vierte Zahl in Spalte (37)"AK" Zeile "7" usw.
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 "tag"
loLetzte = IIf(IsEmpty(.Cells(.Rows.Count, 1)), .Cells(.Rows.Count, 1).End(xlUp).Row, .Rows.Count) + 2
If loLetzte < 5 Then loLetzte = 5
.Cells(loLetzte, 1) = CInt(TextBox1)
Case "tag geteilt"
loLetzte = IIf(IsEmpty(.Cells(.Rows.Count, 1)), .Cells(.Rows.Count, 1).End(xlUp).Row, .Rows.Count) + 1
If loLetzte < 5 Then loLetzte = 5
.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
Was muß ich änder? Im Voraus schonmal vielen Dank.
Dann meine email adresse gibt es nicht mehr. Wie kann ich sie ändern?