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: 9
Default Slow execution changing cell value

I've got the code below that loops through a range of cells fills in
some information for a tournament, including assigning a unique code
for a section judge (i.e. J-AB1). Everything works great, except that
it's extremely slow. I tested the speed of each line of code using a
stopwatch sub that others have posted. Each line runs between 0-4
milliseconds except the line: JdgCell = "J-" & c & i which runs
upward of 320 milliseconds. All it's doing is changing the value of a
cell so I don't understand what the holdup is. I'm using almost the
exact same code in another part of the program and it runs fast. Any
ideas?

Thanks! Nate


For Each c In SCodes
With c.Offset(, 16)

If .Value 0 Then 'check if number of judges 0
For i = 1 To .Value
Set JdgCell = JdgCell.Offset(1)

'fill in school code
JdgCell.Offset(, -2) = c.Text

'fill in school name
JdgCell.Offset(, -1) = c.Offset(, 1).Text

'fill in judge code
JdgCell = "J-" & c & i <---- this line is taking
300+ milliseconds to execute

Next i
End If
End With
Next c
 
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
Execution very slow jimmy[_5_] Excel Programming 4 March 4th 07 09:04 PM
Changing cell value in a range terminates code execution Andy Excel Programming 1 October 31st 06 09:13 AM
Slow code execution side_ Excel Programming 2 October 21st 05 06:44 PM
Automatic Macro Execution Upon Cell Values Changing Brian Excel Programming 3 November 11th 04 04:30 PM
slow macro execution Vasile Dumitrescu Excel Programming 1 October 7th 03 03:31 PM


All times are GMT +1. The time now is 08:58 AM.

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

About Us

"It's about Microsoft Excel"