No VBA:
Sub FileNameFix()
Dim FullRange As Range
Dim CopyIndex As Integer, PasteIndex As Integer
Dim RowIndex As Integer, LastRow As Integer
Dim i As Integer
Dim Text(0 To 10) As String
Dim None(0 To 10) As String
LastRow = Range("A65536").End(xlUp).Row
Set FullRange = Range("A1:B" & LastRow)
CopyIndex = 1
PasteIndex = 1
While CopyIndex < LastRow
For i = 0 To 10
Text(i) = ""
Next i
Do
Text(0) = FullRange.Cells(CopyIndex, 1)
CopyIndex = CopyIndex + 1
Loop Until Mid(Text(0), 2, 1) = ":"
RowIndex = 1
Do
Text(RowIndex) = FullRange.Cells(CopyIndex, 1)
None(RowIndex) = FullRange.Cells(CopyIndex, 2)
CopyIndex = CopyIndex + 1
RowIndex = RowIndex + 1
Loop Until Right(Text(RowIndex - 1), 3) = "doc"
For i = 1 To RowIndex - 1
If None(i) <> "None" Then
Text(0) = Text(0) + "\" + Text(i)
End If
Next i
Sheets("Sheet2").Cells(PasteIndex, 1) = Text(0)
PasteIndex = PasteIndex + 1
Wend
End Sub