Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Any easier way than looping on ranges

Hi,

My problem goes like this. I have 5 tables within a sheet.

Each table consist of variable no of columns where recordsar
inputted.

Each table is separated from another tables by a variable no of column
with "blank" records.

Is there any way I can improve on the following code (I find it to
slow)?


StartC1 = m

Do
'<expression1......
StartC1 = StartC1 + 1
Loop Until Cells(Rowi, StartC1).Value = Empty

StartC2 = StartC1

Do
'<expression1......
StartC2 = StartC2 + 1
Loop Until Cells(501, StartC2).Value < Empty

StartC3 = StartC2
Do
'<expression1......
StartC3 = StartC3 + 1
Loop Until Cells(501, StartC3).Value = Empty

etc....

StartC2 = StartC2 - 1



More Power!!!

BR,
Billabon

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Any easier way than looping on ranges

Selection.End(xlToRight).Select

will do what Ctrl+RightArrow does. It should speed it up spectacularly.

HTH,
Nikos

"Billabong " wrote in message
...
Hi,

My problem goes like this. I have 5 tables within a sheet.

Each table consist of variable no of columns where recordsare
inputted.

Each table is separated from another tables by a variable no of columns
with "blank" records.

Is there any way I can improve on the following code (I find it too
slow)?


StartC1 = m

Do
'<expression1......
StartC1 = StartC1 + 1
Loop Until Cells(Rowi, StartC1).Value = Empty

StartC2 = StartC1

Do
'<expression1......
StartC2 = StartC2 + 1
Loop Until Cells(501, StartC2).Value < Empty

StartC3 = StartC2
Do
'<expression1......
StartC3 = StartC3 + 1
Loop Until Cells(501, StartC3).Value = Empty

etc....

StartC2 = StartC2 - 1



More Power!!!

BR,
Billabong


---
Message posted from http://www.ExcelForum.com/



Reply
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
LOOPING multiple ranges Jase Excel Discussion (Misc queries) 1 April 7th 08 06:21 PM
looping through ranges: how to speed up? fra Excel Programming 8 June 29th 04 03:38 AM
Is there an easier way to address ranges?? dororke[_7_] Excel Programming 2 December 22nd 03 04:30 PM
Looping through Ranges of Rows MS News Excel Programming 6 December 9th 03 06:13 AM
Looping through Ranges of Rows MS News Excel Programming 0 December 8th 03 11:42 AM


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