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: 10
Default Direction of looping through objects

I've got a For loop cycling through all the selected cells and
manually calculating them. However, it always calculates them by row
and it calculates much faster if going down the way but I don't want
to select each column and run my macro individually. Any ideas for
making the for loop move to the next cell down as it's looping through
the selected cells?

Sub CalcRange()
Dim nocells, currcell As Double
Dim Cell As Object

ActiveSheet.Activate

nocells = Selection.Cells.count
currcell = 0

For Each Cell In Selection
currcell = currcell + 1
Application.StatusBar = Int(currcell * 100 / nocells) & "%
complete"
Cell.Calculate
Next Cell
Application.StatusBar = False
End Sub
 
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
Excel VBA Class Objects - Parent & Successor Objects [email protected] Excel Programming 1 January 15th 07 12:06 AM
Looping Thru Objects in UserForms RobC[_3_] Excel Programming 2 January 25th 05 10:55 PM
Unable to remove Sheet objects in the Microsoft Excel Objects Adrian[_7_] Excel Programming 1 August 26th 04 10:49 PM
looping and objects Rune[_2_] Excel Programming 6 July 10th 04 05:31 PM
Direction for looping through a Selection. Bob J. Excel Programming 2 September 16th 03 01:49 PM


All times are GMT +1. The time now is 06:49 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"