Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default simple loop question

i want to write a loop that will run until it reaches cell E333, starting at
E1.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default simple loop question

You should write a macro resembling this:

Sub myMacro ()
set myRange = Range("E1:E333")
For Each c in myRange.Cells
' precise what You want to do with those cells
Next c
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default simple loop question

"For" will not work because i am not running the code 333 times. Would this
code compile:

Do While in MyRange.Cells
xxx
Loop


"rumi" wrote:

You should write a macro resembling this:

Sub myMacro ()
set myRange = Range("E1:E333")
For Each c in myRange.Cells
' precise what You want to do with those cells
Next c
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default simple loop question

That was my original plan, until i realized i don't want to run it 333, or
once per cell. The code in the loop is searching for a specific value, i want
the search to only take place between E1 and E333, and once it reaches E333
stop searching.

"Jim May" wrote:

For i = 1 to 333
'your code here
next i


"Rob" wrote:

i want to write a loop that will run until it reaches cell E333, starting at
E1.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default simple loop question

For i = 1 to 333
'your code here
next i


"Rob" wrote:

i want to write a loop that will run until it reaches cell E333, starting at
E1.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default simple loop question

shouldn't take that long to do it, just turn off the screenupdating.

--


Gary


"Rob" wrote in message
...
That was my original plan, until i realized i don't want to run it 333, or
once per cell. The code in the loop is searching for a specific value, i
want
the search to only take place between E1 and E333, and once it reaches
E333
stop searching.

"Jim May" wrote:

For i = 1 to 333
'your code here
next i


"Rob" wrote:

i want to write a loop that will run until it reaches cell E333,
starting at
E1.



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
Simple loop? bushtor Excel Programming 3 September 13th 05 01:45 PM
If-Else Simple Loop function Junior728 Excel Programming 3 August 1st 05 09:27 AM
Simple question on For...Next loop Alex Excel Programming 1 July 26th 05 03:30 PM
Some help w/ simple loop, please? terry b Excel Programming 6 February 6th 05 06:17 PM
simple loop macro jim27[_3_] Excel Programming 0 October 17th 04 06:40 PM


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