LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default SLOW Code...

Hello,

I have been working in excel for a little while now and am able to do a
few things in code but my abilities are still limited. I have a piece of
code that is extremely slow and was looking for help on tracking down the
problem.

I have a tab (Crew Schedules) and a tab (Crew Raw Data). One is for the
crew schedules and the other is for saving a revolving six weeks. When
someone enters data into the crew schedule the 'Change Event' fires - puts
the data just entered into the Crew Raw Data and then puts the formula back
into the cell inorder to lookup th enewly stored data. This is great. All
is well except sometimes a user needs to copy schedule data onto the crew
schedule. The change event fires and runs right but it is VERY SLOW. It can
be minutes depending on the volume of data being pasted. The data will never
be more than 28 rows by 8 columns... but still.

Any ideas on how to move this faster? Here is some code...

Application.ScreenUpdating = False
Application.EnableEvents = False

For Each C In Target

With C

'Lookup Row / Column values
intCol = Cells(5, C.Column).Value
intRow = Cells(C.Row, 26).Value


'Move the data to the database
Worksheets("Crew Raw Data").Cells(intRow, intCol).Value = C.Value

FixFormula:

'Fix the formula
Select Case C.Row
Case 76
C.Formula = "=IF(INDIRECT(" & strQuote & "'Crew Raw Data'!" & _
strQuote & "& ADDRESS($Z" & C.Row & "," & strCol & "$5))=" & _
strQuote & strQuote & ",0,INDIRECT(" & _
strQuote & "'Crew Raw Data'!" & strQuote & " & ADDRESS($Z" & _
C.Row & "," & strCol & "$5)))"
Case Else
C.Formula = "=IF(INDIRECT(" & strQuote & "'Crew Raw Data'!" & _
strQuote & "& ADDRESS($Z" & C.Row & "," & strCol & "$5))=" & _
strQuote & strQuote & "," & strQuote & strQuote & ",INDIRECT(" & _
strQuote & "'Crew Raw Data'!" & strQuote & " & ADDRESS($Z" & _
C.Row & "," & strCol & "$5)))"

End Select

Thanks for looking,
Ernst Guckel
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
QUERY & HELP: so slow executing VBA code... :S John Keith Excel Worksheet Functions 3 February 13th 06 03:47 PM
Code WAY too slow... (worksheet_change event) [email protected] Excel Programming 0 January 11th 05 08:34 PM
code running super slow... gaba Excel Programming 3 November 20th 04 02:35 AM
Slow Code Frank Kabel Excel Programming 1 July 23rd 04 09:28 AM
Is this slow code? Tom Excel Programming 4 March 3rd 04 11:18 PM


All times are GMT +1. The time now is 09:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"