Formatproblem in UF
09.06.2005 21:41:17
Lorenz
Habe folgendes Problem:
In einer UF lese ich in 27 TextBoxen die Daten aus 27 Spalten aus dem Sheet "Inhalte" aus. Soweit alles OK.
Jetzt mein Problem :
Spalte 12 muss as Date "Format[12.05.2005]", sowie Spalte 13 bis 17 as Time "Format[12:30]"
ausgelesen, in textbox dargestellt und in "Inhalte eingetragen werden.
Private Sub cmdNeu_Click()
Dim wks As Worksheet, iRow As Integer, iCol As Integer
Set wks = Worksheets("Inhalte")
With wks
iRow = .Cells(Rows.Count, 1).End(xlUp).Row + 1
For iCol = 1 To 27
.Cells(iRow, iCol) = Controls("TextBox" & iCol).Value
Next iCol
End With
End Sub
Private Sub ComboBox1_Change()
Dim iCounter As Integer
For iCounter = 1 To 27
Controls("TextBox" & iCounter).Value = _
Worksheets("Inhalte").Cells(ComboBox1.ListIndex + 19, iCounter)
Next iCounter
End Sub
Private Sub UserForm_Initialize()
With Worksheets("Inhalte")
ComboBox1.List = .Range(.Cells(19, 1), .Cells(.UsedRange.Rows.Count, 1)).Value
End With
End Sub
Danke Lorenz