Thread: FILE 2 SLOW
View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default FILE 2 SLOW

Mostly from lurking in the newsgroups and trying things myself.

You may want to invest in a book, too. John Walkenbach's are very good to
start.

Debra Dalgleish has a list of books at her site:
http://www.contextures.com/xlbooks.html



wrote:

OMG that worked perfect. thank u so much. what did u use to learn
more? i would like to learn alot more.

On Mar 11, 3:51 pm, Dave Peterson wrote:
Change this line:
Application.Calculation = x1CalculationManual = False
to
Application.Calculation = xlCalculationManual
(remove the "= False" and change x1 (x-one) to XL (x-ell))

And same with this line:
Application.Calculation = x1CalculationAutomatic = True
becomes:
Application.Calculation = xlCalculationAutomatic





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 -


--

Dave Peterson- Hide quoted text -

- Show quoted text -


--

Dave Peterson