Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cell.Value = Replace(Left(str2, 7), "-", "") & Replace(Left(str2, 7), ",", ".")
- For Each cell In Range("o2:o50000")
- Dim str2 As String
- If cell.Value <> "" Then
- str2 = cell.Value
- cell.Value = Replace(Left(str2, 7), "-", "") 'Left(str2, 6)
- End If
- Next cell
- Private Sub UserForm_Initialize()
- If Dir("C:UsersibruDocumentspi2.xls") <> "" Then
- Workbooks.Open Filename:="C:UsersibruDocumentspi2.xls"
- Else
- If Dir("C:UsershsegDocumentspi2.xls") <> "" Then
- Workbooks.Open Filename:="C:UsershsegDocumentspi2.xls"
- Else
- If Dir("C:UsersjlamDocumentsexportedexcellfilespi2.xls") <> "" Then
- Workbooks.Open Filename:="C:UsersjlamDocumentsexportedexcellfilespi2.xls"
- Else
- If Dir("e:pi2.xls") <> "" Then
- Workbooks.Open Filename:="e:pi2.xls"
- Else
- If Dir("f:pi2.xls") <> "" Then
- Workbooks.Open Filename:="f:pi2.xls"
- Else
- If Dir("g:pi2.xls") <> "" Then
- Workbooks.Open Filename:="g:pi2.xls"
- Else
- If Dir("h:pi2.xls") <> "" Then
- Workbooks.Open Filename:="h:pi2.xls"
- Else
- If Dir("i:pi2.xls") <> "" Then
- Workbooks.Open Filename:="i:pi2.xls"
- Else
- If Dir("j:pi2.xls") <> "" Then
- Workbooks.Open Filename:="j:pi2.xls"
- Else
- If Dir("k:pi2.xls") <> "" Then
- Workbooks.Open Filename:="k:pi2.xls"
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- TextBox11.Value = Format(Now, "long date")
- Range("ad2:ad50000").Copy Destination:=Range("aC2:aC50000")
- ComboBox6 = Format(ComboBox6, "dd/mm/yyyy")
- With ComboBox6
- For Each cell In Range("ad2:ad50000")
- If cell.Value <> "" Then
- cell.Value = Format(cell.Value, "dd/mm/yyyy")
- cell.Value = Replace(cell.Value, "dd-mm-yyyy", "dd/mm/yyyy")
- ComboBox6.AddItem ""
- ComboBox6.AddItem Format(cell.Value, "dd/mm/yyyy")
- End If
- Next cell
- Dim i As Long
- Dim j As Long
- For i = 0 To .ListCount + 1
- For j = .ListCount - 1 To (i + 1) Step -1
- If .List(j) = .List(i) Then
- .RemoveItem j
- End If
- Next
- Next
- End With
- With ComboBox1
- For Each cell In Range("ag2:ag50000")
- If cell.Value <> "" Then
- ComboBox1.AddItem cell.Value
- End If
- Next cell
- Call RemoveDuplicates(1)
- End With
- With Me.ListBox8
- For Each cell In Range("ad2:ad50000").SpecialCells(xlCellTypeVisible)
- If cell.Value <> "" Then
- If Range("c" & cell.Row).Value > "" Then
- If Range("ai" & cell.Row).Value > "" Then
- val1 = (Format(Range("c" & cell.Row).Value))
- val2 = (Format(Range("ai" & cell.Row).Value))
- .AddItem cell.Row
- .List(.ListCount - 1, 0) = Left(val1, 5)
- .List(.ListCount - 1, 1) = Left(val2, 3)
- End If
- End If
- End If
- Next cell
- Sort = True
- Call RemoveDupli(1)
- End With
- Range("Ad2:Ad50000").NumberFormat = "dd/mm/yyyy"
- Range("Ae2:Ae50000").NumberFormat = "hh:mm:ss"
- Range("Ac2:Ac50000").NumberFormat = "hh:mm:ss"
- ComboBox6 = Format(ComboBox6, "dd/mm/yyyy")
- For Each cell In Range("c2:c50000")
- Dim str As String
- If cell.Value <> "" Then
- str = cell.Value
- cell.Value = Left(str, 6)
- End If
- Next cell
- For Each cell In Range("o2:o50000")
- Dim str2 As String
- If cell.Value <> "" Then
- str2 = cell.Value
- cell.Value = Replace(Replace(Left(str2, 7), "-", ""), ",", ".")
- End If
- Next cell
- With Sheets("Sheet0")
- Dim r As Range, n As Long
- n = Cells(Rows.count, 1).End(xlUp).Row
- Set r = Range("A1:A" & n).Cells.SpecialCells(xlCellTypeVisible)
- TextBox134.Value = ""
- TextBox134.Value = r.count - 1
- End With
- For Each cell In Range("af2:af50000").SpecialCells(xlCellTypeVisible)
- If cell.Value > TimeValue("00:15:00") Then
- '12/11/17
- With Me.ListBox10
- .AddItem cell.Row
- .List(.ListCount - 1, 0) = cell.Row
- If Range("ag" & cell.Row).Value = "inp10 - Mireille" Then .List(.ListCount - 1, 1) = "Mireille"
- If Range("ag" & cell.Row).Value = "inp14 - Fouzia" Then .List(.ListCount - 1, 1) = "Fouzia"
- If Range("ag" & cell.Row).Value = "inp13 - Charline" Then .List(.ListCount - 1, 1) = "Charline"
- If Range("ag" & cell.Row).Value = "inp1 - Jacqi" Then .List(.ListCount - 1, 1) = "Jacqi"
- If Range("ag" & cell.Row).Value = "inp4 - Kimberley" Then .List(.ListCount - 1, 1) = "Kimberly"
- If Range("ag" & cell.Row).Value = "inp5 - Charlene" Then .List(.ListCount - 1, 1) = "Charlene"
- If Range("ag" & cell.Row).Value = "inp8 - Mieke" Then .List(.ListCount - 1, 1) = "Mieke"
- If Range("ag" & cell.Row).Value = "JOB4 - job4 student" Then .List(.ListCount - 1, 1) = "Lisa"
- If Range("ag" & cell.Row).Value = "pick1 - Sorin" Then .List(.ListCount - 1, 1) = "Denis"
- If Range("ag" & cell.Row).Value = "pick1 - Denis" Then .List(.ListCount - 1, 1) = "Denis"
- If Range("ag" & cell.Row).Value = "pick2 - Abdel" Then .List(.ListCount - 1, 1) = "Abdel"
- If Range("ag" & cell.Row).Value = "pick3 - Pieter-Jan" Then .List(.ListCount - 1, 1) = "Pieter-Jan"
- If Range("ag" & cell.Row).Value = "pick4 - Hugo" Then .List(.ListCount - 1, 1) = "Hugo"
- If Range("ag" & cell.Row).Value = "pick5 - Nicolas" Then .List(.ListCount - 1, 1) = "Nicolas"
- If Range("ag" & cell.Row).Value = "pick6 - MO" Then .List(.ListCount - 1, 1) = "Dieter"
- If Range("ag" & cell.Row).Value = "pick6 - Dieter" Then .List(.ListCount - 1, 1) = "Dieter"
- If Range("ag" & cell.Row).Value = "pick9 - Sebastien" Then .List(.ListCount - 1, 1) = "Sebastien"
- If Range("ag" & cell.Row).Value = "inb1 - Francky" Then .List(.ListCount - 1, 1) = "Francky"
- If Range("ag" & cell.Row).Value = "inb3 - Kevin" Then .List(.ListCount - 1, 1) = "Kevin"
- If Range("ag" & cell.Row).Value = "inp2 - Daniela" Then .List(.ListCount - 1, 1) = "Daniela"
- If Range("ag" & cell.Row).Value = "marsh2 - Valerie" Then .List(.ListCount - 1, 1) = "Valerie"
- If Range("ag" & cell.Row).Value = "reach - Ludovic" Then .List(.ListCount - 1, 1) = "Ludovic"
- If Range("ag" & cell.Row).Value = "SV2 - Jurgen" Then .List(.ListCount - 1, 1) = "Jurgen"
- If Range("ag" & cell.Row).Value = "SV1 - Ilse" Then .List(.ListCount - 1, 1) = "Ilse"
- If Range("ag" & cell.Row).Value = "CVDM - Carl Van De Moortele" Then .List(.ListCount - 1, 1) = "Carl VDM"
- .List(.ListCount - 1, 2) = (Format(Range("af" & cell.Row).Value, "h:mm:ss"))
- .List(.ListCount - 1, 3) = " Voor "
- .List(.ListCount - 1, 4) = (Format(Range("w" & cell.Row).Value))
- End With
- End If
- Next cell
- Sort = True
- If ToggleButton1.Enabled = True Then
- ToggleButton1.Caption = "Foto Uit"
- Else
- ToggleButton1.Caption = "Foto Aan"
- End If
- End Sub
- this is my vba code initialize when opening the pi2.xls
Add Comment
Please, Sign In to add comment