ich möchte gerne in einer Textbox die ich in eine Userform eingebunden habe den Wert aus Blatt3 Zelle A1 +1 übernehmen.
Wie bekomme ich die Berechnung in die Textbox ?
Gruß
Stefan
TextBox1 = Sheets("Tabelle3").Cells(1, 1) + 1 'TextBoxname anpassen
Private Sub UserForm_Initialize()
TextBox1 = Sheets("Tabelle3").Cells(1, 1) + 1 'TextBoxname anpassen
End sub
Die Datei https://www.herber.de/bbs/user/63568.xls wurde aus Datenschutzgründen gelöscht
Private Sub UserForm_Initialize()
TextBox11 = Sheets("Alle").Cells(1, 1) + 1
End Sub
s
Private Sub UserForm_Initialize()
'TextBox11 = Application.WorksheetFunction.Sum(Sheets("Alle").Range("Z1:Z100"))+1
'TextBox11 = Sheets("Alle").Range("A1") + 1
'TextBox11 = Application.WorksheetFunction.CountIf(Sheets("Alle").Range("A2:A100"), ">0") + 1
End Sub
If LRow
Private Sub UserForm_Initialize()
TextBox11 = Sheets("Variablen").Range("M2") + 1
End Sub
Private Sub CommandButton1_Click()
Dim LRow As Long
If ComboBox1 "" Then
'Textbox angeben wo die Tabelle drin steht
With Workbooks("Recherche_Ergebnisse.xls").Sheets(CStr(ComboBox1))
LRow = .Cells(.Rows.Count, 1).End(xlUp).Row 'letzte Zeile?
LRow = LRow + 1 'nächste leere Zeile
.Cells(LRow, 1) = (TextBox11) 'Lfd.Nr.
.Cells(LRow, 2) = (TextBox1) 'Arbeitgeber
.Cells(LRow, 4) = (TextBox2) 'PLZ
.Cells(LRow, 5) = (TextBox3) 'Ort
.Cells(LRow, 3) = (TextBox4) 'Straße
.Cells(LRow, 6) = (TextBox5) 'Erstellungsdatum
End With
With Workbooks("Recherche_Ergebnisse.xls").Sheets("Alle")
LRow = .Cells(.Rows.Count, 1).End(xlUp).Row 'letzte Zeile?
LRow = LRow + 1 'nächste leere Zeile
.Cells(LRow, 1) = (TextBox11) 'Lfd.Nr.
.Cells(LRow, 2) = (TextBox1) 'Arbeitgeber
.Cells(LRow, 4) = (TextBox2) 'PLZ
.Cells(LRow, 5) = (TextBox3) 'Ort
.Cells(LRow, 3) = (TextBox4) 'Straße
.Cells(LRow, 6) = (TextBox5) 'Erstellungsdatum
With Workbooks("Recherche_Ergebnisse.xls").Sheets("Variablen")
.Range("M2") = (TextBox11) 'Lfd.Nr
End With
'Textboxen leeren
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
ComboBox1.ListIndex = -1
End With
End If
UserForm1.Hide
End Sub
Die UF wird mit einem CMD auf Blatt Gesamt geöffnet.
Private Sub UserForm_Activate()
TextBox11 = Sheets("Variablen").Range("M2") + 1
End Sub
dim i as long
For i= 1 To Sheets.Count
Sheets(i).Protect ("Passwort")
Next i