Dieses Forum nutzt Cookies
Dieses Forum verwendet Cookies, um deine Login-Informationen zu speichern, wenn du registriert bist, und deinen letzten Besuch, wenn du es nicht bist. Cookies sind kleine Textdokumente, die auf deinem Computer gespeichert werden. Die von diesem Forum gesetzten Cookies werden nur auf dieser Website verwendet und stellen kein Sicherheitsrisiko dar. Cookies aus diesem Forum speichern auch die spezifischen Themen, die du gelesen hast und wann du zum letzten Mal gelesen hast. Bitte bestätige, ob du diese Cookies akzeptierst oder ablehnst.

Ein Cookie wird in deinem Browser unabhängig von der Wahl gespeichert, um zu verhindern, dass dir diese Frage erneut gestellt wird. Du kannst deine Cookie-Einstellungen jederzeit über den Link in der Fußzeile ändern.

Textfeld sichtbar unsichtbar
#1
Habe ein Textfeld, was beim Start der UserForm unsichtbar ist.
Diese soll erscheinen, sobals kein Sub Exit mehr kommt und danach soll die Tabelle gefüllt werden inm Hintergrund.

Unsichtbar beim Start funzt, nur wird das Textfeld erst sichtbar, wenn das Makro durchgelaufen ist.

Mein Code:
Code:
Private Sub cmdSpeichern_Click()
'Daten speichern, Formular schließen

Dim i As Long
Dim last As Long

Dim lngSuch
Dim LRow As Long
Dim rngC As Range

'cobAuftrag = ""

If txtAuftragsnummer = "" Then
MsgBox ("Bitte das Felder " & """" & "Auftragsnummer" & """" & " ausfüllen!")
Exit Sub
End If

LRow = Cells(Rows.Count, 1).End(xlUp).Row
lngSuch = Me.txtAuftragsnummer.Value

Set rngC = Range("D4:D" & LRow).Find(lngSuch, _
   Range("D" & LRow), xlValues)

With Bearbeiten
   If Not rngC Is Nothing Then
   MsgBox "Auftragsnummer " & """" & lngSuch & """" & " ist bereits vorhanden!"
     
   Else

If cboDatum = False And txtDatum < Date Then
MsgBox ("Bitte das aktuelle Datum " & """" & Date & """" & " oder ein in der Zukunft liegendes Datum eintragen!")
Exit Sub
End If

If txtDestination = "" Then
MsgBox ("Bitte das Felder " & """" & "Destination" & """" & " ausfüllen!")
Exit Sub
End If

If txtProdukt = "" Then
MsgBox ("Bitte das Felder " & """" & "Produkt" & """" & " ausfüllen!")
Exit Sub
End If

If txtMenge = "" Then
MsgBox ("Bitte das Felder " & """" & "Menge" & """" & " ausfüllen!")
Exit Sub
End If

If txtFremd = "LKW Fremd" And txtLkw = "" Then
MsgBox ("Bitte eine Auswahl zum Feld " & """" & "Fremd/Pentol" & """" & " treffen!")
Exit Sub
End If

If txtStatus = "" Then
MsgBox ("Bitte das Felder " & """" & "Status" & """" & " ausfüllen!")
Exit Sub
End If

If txtW_Container = "" Then
MsgBox ("Bitte das Felder " & """" & "weitere Container" & """" & " ausfüllen!")
Exit Sub
End If

If txtVersandstatus = "" Then
MsgBox ("Bitte das Felder " & """" & "Versandstatus" & """" & " ausfüllen!")
Exit Sub
End If

Label5.Visible = True

'Hauptnummer
last = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row + 1 'letzte Zeile

If cboDatum <> False Then
ActiveSheet.Cells(last, 3).Value = ""
Else
ActiveSheet.Cells(last, 3).Value = Format((Me.txtDatum.Value), "dd.mm.yyyy")
End If

ActiveSheet.Cells(last, 4).Value = Me.txtAuftragsnummer.Value
ActiveSheet.Cells(last, 5).Value = Me.txtDestination.Value
ActiveSheet.Cells(last, 6).Value = Me.txtProdukt.Value
ActiveSheet.Cells(last, 7).Value = Me.txtMenge.Value
ActiveSheet.Cells(last, 8).Value = Me.txtCharge.Value
ActiveSheet.Cells(last, 9).Value = Me.txtFremd.Value
ActiveSheet.Cells(last, 10).Value = Me.txtLkw.Value
ActiveSheet.Cells(last, 11).Value = Me.txtContainer.Value
ActiveSheet.Cells(last, 12).Value = Me.txtPlombennummer.Value
ActiveSheet.Cells(last, 13).Value = Me.txtZollplombe.Value
ActiveSheet.Cells(last, 14).Value = Me.txtSchiff.Value

If IsDate(Me.txtEta.Value) Then   'kann der Inhalt als Datum erkannt werden?
  ActiveSheet.Cells(last, 15).Value = Format((Me.txtEta.Value), "dd.mm.yyyy")
Else
  ActiveSheet.Cells(last, 15).Value = Me.txtEta.Value
End If

ActiveSheet.Cells(last, 16).Value = Me.txtStatus.Value
ActiveSheet.Cells(last, 17).Value = CDec(Me.txtW_Container.Value)
ActiveSheet.Cells(last, 18).Value = Me.txtInfo.Value
ActiveSheet.Cells(last, 19).Value = Me.txtVersandstatus.Value

For i = 1 To txtW_Container
    last = last + 1

    ActiveSheet.Cells(last, 3).Value = Format((Me.txtDatum.Value), "dd.mm.yyyy")
    ActiveSheet.Cells(last, 4).Value = Me.txtAuftragsnummer.Value & "-" & i
    ActiveSheet.Cells(last, 5).Value = Me.txtDestination.Value
    ActiveSheet.Cells(last, 6).Value = Me.txtProdukt.Value
    ActiveSheet.Cells(last, 7).Value = Me.txtMenge.Value
    ActiveSheet.Cells(last, 8).Value = Me.txtCharge.Value
    ActiveSheet.Cells(last, 9).Value = Me.txtFremd.Value
    ActiveSheet.Cells(last, 10).Value = Me.txtLkw.Value
    ActiveSheet.Cells(last, 11).Value = Me.txtContainer.Value
    ActiveSheet.Cells(last, 12).Value = Me.txtPlombennummer.Value
    ActiveSheet.Cells(last, 13).Value = Me.txtZollplombe.Value
    ActiveSheet.Cells(last, 14).Value = Me.txtSchiff.Value
   
    If IsDate(Me.txtEta.Value) Then   'kann der Inhalt als Datum erkannt werden?
        ActiveSheet.Cells(last, 15).Value = Format((Me.txtEta.Value), "dd.mm.yyyy")
    Else
        ActiveSheet.Cells(last, 15).Value = Me.txtEta.Value
    End If
   
    ActiveSheet.Cells(last, 16).Value = Me.txtStatus.Value
    ActiveSheet.Cells(last, 17).Value = CDec(Me.txtW_Container.Value)
    ActiveSheet.Cells(last, 18).Value = Me.txtInfo.Value
    ActiveSheet.Cells(last, 19).Value = Me.txtVersandstatus.Value



Next

MsgBox ("Der Auftrag " & """" & Me.txtAuftragsnummer.Value & """" & " wurde hinzugefühgt!")

If txtW_Container > 0 Then
MsgBox ("Es wurden noch " & """" & Me.txtW_Container.Value & """" & "weitere Container angelegt!")
End If
   End If
End With

'letztezeile = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
'Range("C4:S" & letztezeile).HorizontalAlignment = xlLeft 'Zellenausrichtung

Unload Me
End Sub

Label5.Visible = True  soll sichtbar werden, wenn kein Exit sub mehr stattfindet und dann die Einträge stattfinden.

Danke für Eure Hilfe
Antworten Top
#2
Kleiner Hinweis: "das Felder" passt nicht  Singular: "das Feld", Plural: "die Felder"

Wofür soll das Label denn eingeblendet werden?
Nach den Prüfungen erfolgt keine Benutzerinteraktion mehr.  Es gibt nur die Abschlußmeldung und dann wird die Userform entladen.

Normalerweise sollte das Einblenden aber funktionieren. Vielleicht wird das Label ja von einem andern Element überlagert.
Antworten Top
#3
Hallo,

probiere mal so:

Code:
Label5.Visible = True
Me.Repaint

Gruß, Uwe
Antworten Top
#4
Code:
Label5.Visible = True

Me.Repaint
Genau das ist die Lösung!

Vielen Dank!
Antworten Top


Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste