Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Macro1
- Dim searchre as Integer
- Dim doc as object
- Dim my_cell as object
- Dim TimingInfo
- Dim start_hour as Integer
- Dim start_min as Integer
- Dim start_sec as Integer
- Dim start_milsec as Integer
- Dim end_hour as Integer
- Dim end_min as Integer
- Dim end_sec as Integer
- Dim end_milsec as Integer
- Dim startmin_insecs as Integer
- Dim starthour_insecs as Integer
- Dim endhour_insecs as Integer
- Dim endmin_insecs as Integer
- Dim start_totalsecs as Integer
- Dim end_totalsecs as Integer
- Dim startunformtime as String
- Dim startformtime as String
- Dim endunformtime as String
- Dim endformtime as String
- Dim row
- Dim Truncell
- Dim my_celllen as Integer
- Dim num_cell
- row = 0
- doc = ThisComponent
- my_sheets = doc.Sheets(0)
- my_cell = my_sheets.getCellByPosition(1,row)
- TimingInfo = my_sheets.getCellByPosition(2,row)
- Do Until my_cell.String = ""
- my_cell = my_sheets.GetCellByPosition(1,row)
- Truncell = my_sheets.GetCellByPosition(3,row)
- num_cell = my_sheets.GetCellByPosition(0,row)
- searchre = InStr(my_cell.String, "Dialogue")
- TimingInfo = my_sheets.getCellByPosition(7,row)
- start_hour = Mid(my_cell.String, 13, 1)
- start_min = Mid(my_cell.String, 15, 2)
- start_sec = Mid(my_cell.String, 18, 2)
- start_milsec = Mid(my_cell.String, 21, 2)
- end_hour = Mid(my_cell.String, 24, 1)
- end_min = Mid(my_cell.String, 26, 2)
- end_sec = Mid(my_cell.String, 29, 2)
- end_milsec = Mid(my_cell.String, 32, 2)
- startmin_insecs = start_min * 60
- starthour_insecs = start_hour * 3600
- endhour_insecs = end_hour * 3600
- endmin_insecs = end_min *60
- start_totalsecs = start_sec + startmin_insecs + starthour_insecs
- end_totalsecs = end_sec + endmin_insecs + endhour_insecs
- startunformtime = start_totalsecs & "." & start_milsec
- startformtime = Format(startunformtime, "#####.000000")
- endunformtime = end_totalsecs & "." & end_milsec
- endformtime = Format(endunformtime, "#####.000000")
- If searchre = 0 Then
- Else
- TimingInfo.String = startformtime & " " & endformtime & " " & num_cell.String
- my_celllen = Len(my_cell.String)
- my_cell.String = Mid(my_cell.String, 51, my_celllen - 50)
- End If
- Row = Row + 1
- my_cell = my_sheets.GetCellByPosition(1,Row)
- Loop
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement