Sub open_phone1()
i1 = Selection.row
r_1 = blue_before(i1) 'fr("phone_dir")
If i1 < r_1 Then Exit Sub
j1 = fc("left", r_1)
j2 = fc("right", r_1)
If Cells(i1, j1) <> "" Then
open_dir2 (Cells(i1, j1))
End If
If Cells(i1, j2) <> "" Then
open_dir2 Cells(i1, j2), 2
End If
End Sub
Function open_dir2(w, Optional arg1 = 1)
path_dopu = "H:\Program Files\GPSoftware\Directory Opus"
If arg1 = 1 Then
str2 = " OPENINLEFT NEWTAB=findexisting"
Else
str2 = " OPENINRIGHT NEWTAB=findexisting"
End If
str1 = "start /d " & Chr(34) & path_dopu _
& Chr(34) & " dopusrt.exe /acmd GO "
cmd1 (str1 & Chr(34) & w & Chr(34) & str2)
End Function
Function blue_before(i1, Optional j1 = 1)
blue_before = 0
For i = 1 To 1000
If Cells(i1 - i, j1).Interior.ColorIndex = 37 Then
blue_before = i1 - i
Exit Function
End If
Next
End Function