Macro works but the results change later

D

Dave Neve

Hello

I'm not really a VBA person but I have a few macros which people on this group helped me with.

The macros are designed to give a word a 'shape' so that I can remember more easily the tone of the word (rising and falling in particular)

The end result might be a word where the size of each letter gets bigger so that the word looks like a rising tone
eg kaw. (I will give you one of the macros at the end)

Colour is also used the words appear in a table.

The problem is that these macros seem to work ok but the results change over time.

For instance, often two letters in the word have the same size which is wrong.

I've no idea what triggers this change and I can't see a pattern.

Some words suddenly appear with a 'defect' while the next cell down is ok.

I'm definately not imagining this as all the words are given 'shape' by macros and I can see the results immediately

The words are perfect but the next time I open the doc, some have defects.(never seen it change in front of my eyes)

What could be causing this?

Thanks

One of the macros follows:

Sub RisingLong()

Dim wordrange As Range, lrange As Range, i As Long, j As Long
Set wordrange = Selection.Range
j = 2

For i = 1 To wordrange.Characters.Count
Set lrange = wordrange.Characters(i)

If Selection.Characters.Count <= 4 Then
lrange.Font.Size = 8
lrange.Font.Size = lrange.Font.Size + j
j = j + 2
lrange.Font.Spacing = 5
wordrange.Font.Color = wdColorTan
Else
lrange.Font.Size = 8
lrange.Font.Size = lrange.Font.Size + j
j = j + 1
lrange.Font.Spacing = 5
wordrange.Font.Color = wdColorTan


End If
Next i
Selection.Collapse Direction:=wdCollapseEnd

Selection.ExtendMode = False
Selection.Font.Reset

Call NextWordSelect



End Sub
 
Z

zkid

I don't see anything to control moving around in the table itself (from cell
to cell). Does this macro work fine if the text is just in a paragraph and
not inside a table? If that's the case, then your problem is that some of
the cells (and thus content) are skipped.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top