D
deluxes
I am using EXCEL V on OS 10.3.7 on 550mhz titanium powerbook. I have a
large sheet (2500 rows x 90 columns). I am copying values from one
column to another.
Here is the VBA macro
Sub Testput2()
'
Dim AFrom As Range
Dim Time1 As Long, Time2 As Long
Dim Result As Variant
Time1 = Timer
Application.ScreenUpdating = False
Application.Calculation = xlManual
Set AFrom = Range("CE4:CE2541")
With AFrom
.Offset(0, -64).ClearContents
For Each Cell In .Cells
If (Cell.Value <> 0) Then _
Cell.Offset(0, -64).Value = Cell.Value
Next Cell
End With
Application.Calculate
Time2 = Timer
Application.ScreenUpdating = True
MsgBox "Elapsed Time " & Format((Time2 - Time1), "0.00") & _
" Seconds " _
, , "Input Calculations Complete"
End Sub
When I change the line
If (Cell.Value <> 0) Then _
to
If (IsNumeric(Cell.Value)) Then _
the time to execute goes from less than a second to 37 seconds!!
Anybody know a way around this problem.
large sheet (2500 rows x 90 columns). I am copying values from one
column to another.
Here is the VBA macro
Sub Testput2()
'
Dim AFrom As Range
Dim Time1 As Long, Time2 As Long
Dim Result As Variant
Time1 = Timer
Application.ScreenUpdating = False
Application.Calculation = xlManual
Set AFrom = Range("CE4:CE2541")
With AFrom
.Offset(0, -64).ClearContents
For Each Cell In .Cells
If (Cell.Value <> 0) Then _
Cell.Offset(0, -64).Value = Cell.Value
Next Cell
End With
Application.Calculate
Time2 = Timer
Application.ScreenUpdating = True
MsgBox "Elapsed Time " & Format((Time2 - Time1), "0.00") & _
" Seconds " _
, , "Input Calculations Complete"
End Sub
When I change the line
If (Cell.Value <> 0) Then _
to
If (IsNumeric(Cell.Value)) Then _
the time to execute goes from less than a second to 37 seconds!!
Anybody know a way around this problem.