Five plus minutes to execute
just wondering if you've turned screenupdating and calculation off.
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For Each cell In Range("B7:K500")
Do While Left(cell.Value, 1) = ","
cell.Value = Right(cell.Value, Len(cell.Value) - 1)
Loop
Next
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
--
Gary
"CB" wrote in message
...
Sorry for the double post! I accidentally posted in general questions but I
could not figure out how to remove that post or move it into this section.
Can anyone tell me why this piece of code is taking over five minutes to
execute. I actually don't know the total time it takes because I keep giving
up after waiting about five minutes...
For Each cell In Range("B7:K500")
Do While Left(cell.Value, 1) = ","
cell.Value = Right(cell.Value, Len(cell.Value) - 1)
Loop
Next
If anyone could tell me a more efficient way to write the code I would
appreciate it. This is a small part of a larger macro that I would like to
run in under one minute.
Thanks
|