AW: Inhalte aus Zeile in UserForm
25.08.2008 11:52:11
PointOfView
Hallo,
also ich hab das mit dem Kompilierungsfehler dahingehend gelöst, dass ich
Private Sub UserForm_Activate()
SpinButton1 = LoZeile
End Sub
auskommentiert habe. Fehler ist weg. Ich hab jetzt nur noch das Problem, dass wenn kein Bild gefunden wird, direkt ein Fehler kommt. Kann man hier einen ERROR-Handler einbauen? Wenn ja, wie könnte man das realisieren? Hier der Code für den angepassten SpinButton1:
Private Sub SpinButton1_Change()
Dim InfoText As String
With Worksheets("Tabelle1")
Me.txtIDEK = .Cells(Me.SpinButton1.Value, 1).Value
Me.txtNameEK = .Cells(Me.SpinButton1.Value, 4).Value
Me.txtArtNr = .Cells(Me.SpinButton1.Value, 3).Value
Me.txtWerkstoff = .Cells(Me.SpinButton1.Value, 5).Value
Me.txtAbmessung = .Cells(Me.SpinButton1.Value, 6).Value
Me.txtNormangabe = .Cells(Me.SpinButton1.Value, 7).Value
Me.txtFarbe = .Cells(Me.SpinButton1.Value, 8).Value
Me.txtZeichnungNr = Format(.Cells(Me.SpinButton1.Value, 9).Value, "hh:mm:ss")
Me.txtEinheit = .Cells(Me.SpinButton1.Value, 10).Value
Me.txtWG2 = .Cells(Me.SpinButton1.Value, 11).Value
Me.txtWG3 = .Cells(Me.SpinButton1.Value, 12).Value
Me.txtWG4 = .Cells(Me.SpinButton1.Value, 13).Value
Me.txtWG5 = .Cells(Me.SpinButton1.Value, 14).Value
Me.txtZugang1 = .Cells(Me.SpinButton1.Value, 15).Value
Me.txtAbgang1 = .Cells(Me.SpinButton1.Value, 16).Value
Me.txtZugang2 = .Cells(Me.SpinButton1.Value, 17).Value
Me.txtAbgang2 = .Cells(Me.SpinButton1.Value, 18).Value
Me.txtZugang3 = .Cells(Me.SpinButton1.Value, 19).Value
Me.txtAbgang3 = .Cells(Me.SpinButton1.Value, 20).Value
' Muster für Mehrere Angane in 1 Feld
' Me.txtTonspur2 = .Cells(Me.SpinButton1.Value, 21).Value & " " & .Cells(Me.SpinButton1.Value, _
22).Value & " " & .Cells(Me.SpinButton1.Value, 23).Value & " " & .Cells(Me.SpinButton1.Value, 24).Value
' Me.txtTonspur2 = .Cells(Me.SpinButton1.Value, 21).Value & " " & .Cells(Me.SpinButton1.Value, _
22).Value & " " & .Cells(Me.SpinButton1.Value, 23).Value & " " & .Cells(Me.SpinButton1.Value, 24).Value
Me.txtMindestbestand = .Cells(Me.SpinButton1.Value, 21).Value
Me.txtLagerbestand = .Cells(Me.SpinButton1.Value, 22).Value
Me.txtBestellbestand = .Cells(Me.SpinButton1.Value, 23).Value
Me.txtGesamtverbrauch = .Cells(Me.SpinButton1.Value, 24).Value
Me.txtOrt = .Cells(Me.SpinButton1.Value, 25).Value
Me.Image1.Picture = LoadPicture(Cells(Me.SpinButton1.Value, 40).Value)
On Error GoTo weiter
Me.txtInfoText = ""
Me.txtInfoText = .Cells(Me.SpinButton1.Value, 4).Comment.Text
' Me.Image1.Picture = LoadPicture(Cells(Me.SpinButton1.Value, 30).Value)
Me.txtMDBLink = .Cells(Me.SpinButton1.Value, 41).Value
' InfoText = .Cells(Me.SpinButton1.Value, 4).Comment.Text
' MsgBox InfoText
End With
weiter:
End Sub
Kann auch gerne meine Musterdatei hochladen.
Viele Grüsse und vielen Dank schon mal im voraus.
PointOfView