ano s textem, jinak mi to tam hodilo misto casu dlouhe cislo..treba 5.01388888888889E-02 misto 1:12:12,0.
v excelu je zadan format bunek na h:mm:ss,0
kod toho formulare je takovy:
Option Explicit
Dim id As Integer, i As Integer, j As Integer, PosledniPlnyRadek As Long
Sub GetData()
PosledniPlnyRadek = Cells(Rows.Count, "C").End(xlUp).Row + 1
If UserForm1.TextBox1.Text <> "" Then
i = 4
Do While i < PosledniPlnyRadek
If Cells(i + 1, 2).Value = UserForm1.TextBox1.Text Then
For j = 2 To 4
UserForm1.Controls("TextBox" & j).Text = Cells(i + 1, j + 1).Text
UserForm1.TextBox5.Text = Cells(i + 1, 1).Text
UserForm1.TextBox6.Text = Cells(i + 1, 7).Text
UserForm1.TextBox7.Text = Cells(i + 1, 8).Text
UserForm1.TextBox8.Text = Cells(i + 1, 6).Text
UserForm1.TextBox9.Text = Cells(i + 1, 10).Text
Next j
End If
i = i + 1
Loop
Else
ClearForm
End If
End Sub
Sub ClearForm()
For j = 1 To 9
UserForm1.Controls("TextBox" & j).Text = ""
Next j
End Sub
Sub EditAdd()
Dim emptyRow As Long, flag As Boolean, PosledniPlnyRadek As Long
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
If UserForm1.TextBox1.Text <> "" Then
flag = False
i = 4
PosledniPlnyRadek = Cells(Rows.Count, "C").End(xlUp).Row + 1
Do While i < PosledniPlnyRadek
If Cells(i + 1, 2).Value = UserForm1.TextBox1.Text Then
flag = True
For j = 2 To 4
Cells(i + 1, j + 1).Value = UserForm1.Controls("TextBox" & j).Text
Cells(i + 1, 1).Value = UserForm1.TextBox5.Text
Cells(i + 1, 7).Value = UserForm1.TextBox6.Text
Cells(i + 1, 8).Value = UserForm1.TextBox7.Text
Cells(i + 1, 6).Value = UserForm1.TextBox8.Text
Next j
End If
i = i + 1
Loop
Windows(Range("L1").Text & ":2").Activate
ActiveSheet.PivotTables("absolutni").PivotCache.Refresh
Windows(Range("L1").Text & ":1").Activate
Else
End If
If flag = False Then
MsgBox "Startovní číslo neexistuje"
End If
End Sub
citovat