+ Reply to Thread
Results 1 to 6 of 6

simple loop question

  1. #1
    Rob
    Guest

    simple loop question

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

  2. #2
    rumi
    Guest

    Re: 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. #3
    Rob
    Guest

    Re: 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. #4
    Rob
    Guest

    RE: 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. #5
    Jim May
    Guest

    RE: 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. #6
    Gary Keramidas
    Guest

    Re: simple loop question

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

    --


    Gary


    "Rob" <[email protected]> wrote in message
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1