Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Counting By Range

  1. #1
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    if i set a range by currentregion
    how do i get the for statement to go through each cell address in the range till it finds what its after?

  2. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-29 19:55, brettvba wrote:
    if i set a range by currentregion
    how do i get the for statement to go through each cell address in the range till it finds what its after?
    do something like this;


    Sub Tester()
    Dim MyRg As Range
    Dim oCell As Range
    'Note D8 is the Top left cell
    'of the current region you want

    Set MyRg = Range("D8").CurrentRegion

    For Each oCell In MyRg
    MsgBox oCell & oCell.Address
    Next

    End Sub

    Kind Regards,
    Ivan F Moala From the City of Sails

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Ivan

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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