View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Brad Brad is offline
external usenet poster
 
Posts: 846
Default Question for Jim Thomlinson or Ron de Bruin

Both of you gentlemen have given great advice

I have a posting in Excel Programming
"Detailed formatting problem" dated on 5/30

One solution was to put the Do...While in a "For i = 1 to 2" and it works
but is this the best solution?

Below was the maco that needs work and yes I will be using range names on
the macro when

Sub ReformatSentences()
Dim RemainingBold As Integer
Dim SecondSentence As Integer
Dim LastSentence As Integer
Dim rowcnt As Integer

shtPrem.Range("o13:s22").Clear
shtPrem.Range("b13:b18").Copy
shtPrem.Range("o13:o18").PasteSpecial xlValues

shtPrem.Range("o13:s22").Justify
shtPrem.Range("o13:s22").Font.Bold = False
rowcnt = 12 + shtPrem.Range("o11").Value
RemainingBold = 158
Do
LastSentence = Len(shtPrem.Range("o" & rowcnt))
If LastSentence <= RemainingBold Then
shtPrem.Range("o" & rowcnt).Font.Bold = True
Else
shtPrem.Range("o" & rowcnt).Characters(LastSentence -
RemainingBold, 158).Font.Bold = True
End If
RemainingBold = RemainingBold - LastSentence
rowcnt = rowcnt - 1
Loop While RemainingBold 0
End Sub


--
Wag more, bark less