T
Tim Childs
Hi
I have a small piece of code that appears to work fine on
small files but when the code is applied to a large file
with a very large number of #NAME errors it "hangs".The VB
code snippet is produced below. (The #NAME errors arise in
a CSV file where the first character in a text field is
a "-").
Please can someone shed some light on this peculiarity?
THANKS
Tim
Dim rTemp As Range
Set rTemp = Cells.Find(What:="#Name?", After:=ActiveCell,
LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:= _
False)
Do While Not rTemp Is Nothing
'Application.ScreenUpdating = False
If Not rTemp Is Nothing Then
With rTemp
.Value = Chr(39) & Mid(.Formula, 2, Len
(.Formula) - 1)
End With
End If
Set rTemp = Cells.Find(What:="#Name?",
After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:= _
False)
Loop
I have a small piece of code that appears to work fine on
small files but when the code is applied to a large file
with a very large number of #NAME errors it "hangs".The VB
code snippet is produced below. (The #NAME errors arise in
a CSV file where the first character in a text field is
a "-").
Please can someone shed some light on this peculiarity?
THANKS
Tim
Dim rTemp As Range
Set rTemp = Cells.Find(What:="#Name?", After:=ActiveCell,
LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:= _
False)
Do While Not rTemp Is Nothing
'Application.ScreenUpdating = False
If Not rTemp Is Nothing Then
With rTemp
.Value = Chr(39) & Mid(.Formula, 2, Len
(.Formula) - 1)
End With
End If
Set rTemp = Cells.Find(What:="#Name?",
After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:= _
False)
Loop