Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VBA Anfänger

Empfohlene Antworten

Veröffentlicht

Hi Leute

ich habe ein Textfeld in einer Userform drin jetzt will ich das Textfeld in ein Feld (C3) in Excel einfügen wie mache ich das?

Danke für die Antworten

Hi,

das geht so in der Art:

Sheets("Tabelle1").Cells(3, 3) = UserForm1.TextBox1.Value

....musst halt entsprechende Namen (Tabelle1, Userform1, Textbox1) noch anpassen :)

Goos

Danke!

Jetzt habe ich aber noch ein anderes Problem.

Wenn ich das ganze so mach wie du gesagt hast also so:

Sheets("Tabelle1").Cells(1, 3) = Eingabe.TextBox1.Value

kann ich dann irgendwie einstellen, das wenn das Programm noch neu gestartet wird, das dann die Eingabe dann in Feld 1, 4 geschieht? Das muß man bestimmt mit einer Schleife machen aber ich weiß nicht mit welcher und wie ich die Schleife einsetzen soll.

Bitte helft mir!

Ich will, das wenn das Programm nochnal gestartet wird, das er dann die Daten in die nächste Zeile schreibt.

ich würds dann so machen:

for i = 3 to tabelle1.columns.count

if tabelle1.cells(1,i) = "" then

'Einfügen des Felders aus der Userform

i = tabelle1.columns.count

end if

next i

Ich hoffe das hilft dir weiter.

MfG

Schaf

  • 3 Wochen später...

Nicht das wieder einer rummotzt, dass ich einen alten Artikel wieder hochhole. Ich war in Urlaub.

Ja nicht so ganz.

Pass auf folgendes:

Ich hab eine Eingabemaske gemacht. Dort werden mehrer Zahlen in die Zeile A1, B1, C1 eingetragen. Wenn ich das Programm jetzt nochmal starte, dann sollen die neuen Zaheln in die Felder A2, B2, und C2 eingetragen werden.

Wie mache ich das?

Danke für die Antworten

Hier ist noch der Quelltext:

Private Sub CommandButton1_Click()

If TextBox0 = "" Then

MsgBox "Bitte geben Sie eine Versandauftragsnummer ein!"

TextBox0.SetFocus

Else

If TextBox1 = "" Then

MsgBox "Bitte geben Sie mindestens eine Spediteurnummer ein!"

TextBox1.SetFocus

Else

Worksheets("Tabelle1").Range("a4").Value = TextBox29.Value

Worksheets("Tabelle1").Range("B4").Value = TextBox0.Value

Worksheets("Tabelle1").Range("c4").Value = TextBox1.Value

Eingabe.Hide

End If

End If

End Sub

Ich hab eine Lösung gefunden nur so ganz sauber ist die nicht, weil der mit dem eintragen der Daten erst in Zeile 33 anfängt.

Private Sub CommandButton1_Click()

Dim i As Long

If TextBox0 = "" Then

MsgBox "Bitte geben Sie eine Auftragsnummer ein!"

TextBox0.SetFocus

Else

If TextBox1 = "" Then

MsgBox "Bitte geben Sie mindestens eine Nummer ein!"

TextBox1.SetFocus

Else

ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Activate

i = ActiveCell.Row + 1

Worksheets("Tabelle1").Range("a" & i).Value = TextBox29.Value

Worksheets("Tabelle1").Range("B" & i).Value = TextBox0.Value

Worksheets("Tabelle1").Range("c" & i).Value = TextBox1.Value

Eingabe.Hide

End If

End If

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.