D
Dave Neve
Hi
I recently asked a question about two docs that use the same .dot as
reference to execute macros and install a toolbar.
One of the docs works very well while the other one (much longer table) has
become unusable due to the speed of execution
Today, I inserted a second table in the slow doc and the macros executed
right away.
So I have concluded that it is the length of the main table in the
problematic doc that is causing the problem and nothing else.
I have copied below one of the macros the speed of which seems to be
affected by the length of the table.
Can anyone help me to get around this problem as I can't wait one minute
each time for a macro to execute.
I selcet the word with the cursor before running the macro.
Thanks in advance
Dave Neve
Sub FallingLong()
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 <= 5 Then
lrange.Font.Size = 18
lrange.Font.Size = lrange.Font.Size - j
j = j + 2
lrange.Font.Spacing = 5
wordrange.Font.Color = wdColorSkyBlue
Else
lrange.Font.Size = 16
lrange.Font.Size = lrange.Font.Size - j
j = j + 1
lrange.Font.Spacing = 5
wordrange.Font.Color = wdColorSkyBlue
End If
Next i
Selection.Collapse Direction:=wdCollapseEnd
Selection.ExtendMode = False
Selection.Font.Reset
Call NextWordSelect
End Sub
I recently asked a question about two docs that use the same .dot as
reference to execute macros and install a toolbar.
One of the docs works very well while the other one (much longer table) has
become unusable due to the speed of execution
Today, I inserted a second table in the slow doc and the macros executed
right away.
So I have concluded that it is the length of the main table in the
problematic doc that is causing the problem and nothing else.
I have copied below one of the macros the speed of which seems to be
affected by the length of the table.
Can anyone help me to get around this problem as I can't wait one minute
each time for a macro to execute.
I selcet the word with the cursor before running the macro.
Thanks in advance
Dave Neve
Sub FallingLong()
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 <= 5 Then
lrange.Font.Size = 18
lrange.Font.Size = lrange.Font.Size - j
j = j + 2
lrange.Font.Spacing = 5
wordrange.Font.Color = wdColorSkyBlue
Else
lrange.Font.Size = 16
lrange.Font.Size = lrange.Font.Size - j
j = j + 1
lrange.Font.Spacing = 5
wordrange.Font.Color = wdColorSkyBlue
End If
Next i
Selection.Collapse Direction:=wdCollapseEnd
Selection.ExtendMode = False
Selection.Font.Reset
Call NextWordSelect
End Sub