+ Reply to Thread
Results 1 to 3 of 3

Thread: Step down a list

  1. #1
    CLR
    Guest

    Step down a list

    Hi All..........
    I have a list that starts in B5 and extends downward for I don't know how
    many rows. I would like to select B5 and run MyCoolMacro, then step down to
    B6 and run MyCoolMacro again, etc etc as far down as there are cells in
    column B with values in them..........help please

    Vaya con Dios,
    Chuck, CABGx3


  2. #2
    Tom Ogilvy
    Guest

    Re: Step down a list

    Sub RunMyCool()
    Dim rng as Range, cell as Range
    With Worksheets("Sheet1")
    .Activate
    set rng = .Range(.Range("B5"),.Range("B5").End(xldown))
    End With
    for each cell in rng
    cell.Select
    MyCoolMacro
    Next
    End Sub

    Assumes your macro works on the activecell.

    --
    Regards,
    Tom Ogilvy


    "CLR" <CLR@discussions.microsoft.com> wrote in message
    news:16D62797-54C6-40CD-B514-04C82FC2BA5F@microsoft.com...
    > Hi All..........
    > I have a list that starts in B5 and extends downward for I don't know how
    > many rows. I would like to select B5 and run MyCoolMacro, then step down

    to
    > B6 and run MyCoolMacro again, etc etc as far down as there are cells in
    > column B with values in them..........help please
    >
    > Vaya con Dios,
    > Chuck, CABGx3
    >




  3. #3
    CLR
    Guest

    Re: Step down a list

    Thanks very much Tom. As usual, your solution does the trick very nicely.

    Vaya con Dios,
    Chuck, CABGx3


    "Tom Ogilvy" wrote:

    > Sub RunMyCool()
    > Dim rng as Range, cell as Range
    > With Worksheets("Sheet1")
    > .Activate
    > set rng = .Range(.Range("B5"),.Range("B5").End(xldown))
    > End With
    > for each cell in rng
    > cell.Select
    > MyCoolMacro
    > Next
    > End Sub
    >
    > Assumes your macro works on the activecell.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "CLR" <CLR@discussions.microsoft.com> wrote in message
    > news:16D62797-54C6-40CD-B514-04C82FC2BA5F@microsoft.com...
    > > Hi All..........
    > > I have a list that starts in B5 and extends downward for I don't know how
    > > many rows. I would like to select B5 and run MyCoolMacro, then step down

    > to
    > > B6 and run MyCoolMacro again, etc etc as far down as there are cells in
    > > column B with values in them..........help please
    > >
    > > Vaya con Dios,
    > > Chuck, CABGx3
    > >

    >
    >
    >


+ 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.2.0