| Mario Anibal Rosas Alvear 478 |
no tenes posibilidad de que ese XLS se exporte bien ?
saludos.
Function BoldEnds(r As Range) As Long
' returns the character position of the first non-bold character
' in the first cell of r
Dim iUB As Long
Dim iLB As Long
Dim iMid As Long
With r(1)
If .HasFormula Or VarType(.Value) <> vbString Then
BoldEnds = -1
ElseIf IsNull(.Font.Bold) Then ' some bold, some not
iUB = Len(.Value)
iLB = 0
Do While iUB - iLB > 1
iMid = (iLB + iUB) \ 2
If .Characters(iMid, 1).Font.Bold Then
iLB = iMid
Else
iUB = iMid
End If
Loop
BoldEnds = iUB
ElseIf .Font.Bold Then
BoldEnds = Len(.Value) + 1
Else
BoldEnds = 1
End If
End With
End Function