View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pete McCosh[_5_] Pete McCosh[_5_] is offline
external usenet poster
 
Posts: 59
Default Help Please Cut/Paste Macro for DVD Subtitles

Pock,

this will work if the cells with no time are actually
blank, rather than having spaces in them or something.
Watch out for the text wrap after the "If" statement. I've
included a few lines at the end which will scroll back up
and delete the entries with no time against them: if you
want to use this just remove the comment marks, if not
leave it as it is.

Cheers, Pete

Sub MatchTitles()

Dim LastRow as integer, LastTime as integer, x as integer

LastRow = ActiveSheet.UsedRange.Rows.Count
LastTime = 2

For x = 2 to LastRow
If Cells(x,1).value & Cells(x,2).value = "" Then
Cells(LastTime,3).value = Cells(LastTime,3).Value_
& "<P" & Cells(x,3).value

Else
LastTime = x
End If

Next x

'For x = LastRow to 2 Step -1

'If cells(x,1)="" then
' rows(x).delete
'End if

'Next x

End Sub