FILE 2 SLOW
runtime error 1004
method calculation of object_application failed
On Mar 11, 1:30*pm, Rpettis31
wrote:
What type of error is it? *
" wrote:
FORSOME REASON ITS NOT WORKING CORRECTLY
IT GIVE ME AN ERROR
here the full code i have on there
Private Sub cmdImport_Click()
Dim j, a, b, g As Integer
Dim strBlah As String
'Application.ScreenUpdating = False
Application.Calculation = x1CalculationManual = False
Sheet12.Range("A9:C2000").Select
Selection.Clear
Selection.WrapText = True
g = 9 'starting row
'For j = 3 To 1000000
* * 'If Sheet2.Cells(j, 1) = "" Then
* * * * 'j = j + 1
* * * * 'GoTo 1
* * 'End If
'Next j
'1:
For a = 2 To 2000
* * strBlah = Sheet2.Cells(a, 6)
* * Sheet12.Cells(g, 1) = strBlah
* * Sheet12.Cells(g, 2) = Sheet2.Cells(a, 14)
* * Sheet12.Cells(g, 3) = Sheet2.Cells(a, 3) & " " & Sheet2.Cells(a,
8) & " " & Sheet2.Cells(a, 10) & " Phn#:" & Sheet2.Cells(a, 11)
* * Sheet12.Cells(g, 4) = Sheet2.Cells(a, 16)
* * g = g + 1
Next a
Application.Calculation = x1CalculationAutomatic = True
'Application.ScreenUpdating = True
End Sub
On Mar 11, 10:08 am, Rpettis31
wrote:
Use the first one at the start of your code Application.Calculation =
x1CalculationManual
This way any calculations will not occur until the program runs. *This
typically causes programs to run slow as Excel will do whatever calculations
on the sheets then returns to the program.
Then before you end your program turn the calculator back on with
Application.Calculation = x1CalculationAutomatic
" wrote:
On Mar 10, 4:05 pm, Rpettis31
wrote:
I did not see if you turned your calculator to manual.
Application.Calculation = x1CalculationManual
' code
Application.Calculation = x1CalculationAutomatic
" wrote:
the excel file im working on performs code too slow. it tak emore than
30min to upload and update everything. is there anything i can do to
make it perform a little faster
heres the code im using:
For a = 2 To 2000
* * strBlah = Sheet5.Cells(a, 6)
* * Sheet10.Cells(g, 1) = strBlah
* * Sheet10.Cells(g, 2) = Sheet5.Cells(a, 14)
* * Sheet10.Cells(g, 3) = Sheet5.Cells(a, 3) & " " & Sheet5.Cells(a,
8) & " " & Sheet5.Cells(a, 10) & " Phn#:" & Sheet5.Cells(a, 11)
* * Sheet10.Cells(g, 4) = Sheet5.Cells(a, 16)
* * g = g + 1
Next a
Application.ScreenUpdating = True- Hide quoted text -
- Show quoted text -
WHICH ONE SHOULD I USE, NOT EXACTLY SURE WHAT IT MEANS- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
|