A
Alex St-Pierre
Hi Tom!
speed. I had an error with Gary's (#1004) and Charles program. As you said,
it is probably related to point b.
For point a. and c. I don't had problem related with these points. By
modifying your program as PeterT, it takes 0.14 seconds. I posted the code
below.
Thanks!
Alex
Sub RemoveWrapText()
Dim time1, time2
time1 = Timer
Dim nm As Name, rng As Range
Dim rng1 As Range, rng2 As Range
For Each nm In ThisWorkbook.Names
Set rng = Nothing
On Error Resume Next
Set rng = Evaluate(nm.Name)
On Error GoTo 0
If Not rng Is Nothing Then
If rng.Parent.Name = ActiveSheet.Name Then
Set rng1 = Intersect(rng, Range("A1:H400"))
If Not rng1 Is Nothing Then
If rng1.WrapText = True Then
rng1.WrapText = False
End If
Set rng1 = Nothing
End If
End If
End If
Next
time2 = Timer
MsgBox (time2 - time1)
End Sub
I posted the speed test in PeterT post. 0.18 seconds refer to your programb. I Check that if it is a range, it is on the same sheet as A1:H400 - if
not, attempting an intersect will lead to an error. (Peter T also tested for
this)
speed. I had an error with Gary's (#1004) and Charles program. As you said,
it is probably related to point b.
For point a. and c. I don't had problem related with these points. By
modifying your program as PeterT, it takes 0.14 seconds. I posted the code
below.
Thanks!
Alex
Sub RemoveWrapText()
Dim time1, time2
time1 = Timer
Dim nm As Name, rng As Range
Dim rng1 As Range, rng2 As Range
For Each nm In ThisWorkbook.Names
Set rng = Nothing
On Error Resume Next
Set rng = Evaluate(nm.Name)
On Error GoTo 0
If Not rng Is Nothing Then
If rng.Parent.Name = ActiveSheet.Name Then
Set rng1 = Intersect(rng, Range("A1:H400"))
If Not rng1 Is Nothing Then
If rng1.WrapText = True Then
rng1.WrapText = False
End If
Set rng1 = Nothing
End If
End If
End If
Next
time2 = Timer
MsgBox (time2 - time1)
End Sub