Select a Range based on cell value

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

Thread: Select a Range based on cell value

  1. #1
    Board Regular
    Join Date
    Nov 2003
    Posts
    159
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Select a Range based on cell value

     
    I would like to select a range based on cell value.

    For example:

    The cells C1:L1 contain the descriptions.
    In cells C2:C13 I have alle the months (01-01-04, 01-02-04, etc.)
    The cells D2:L13 contain supplies.
    Cells D14:L14 contain the totals of the column.

    Now I want to select C1:C13 and the rest of the columns until the value in row 14 reaches 0. E.G. F14 = 0, so I want to select C1:E13. Is this even possible???

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Phoenix, Arizona
    Posts
    1,711
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Select a Range based on cell value

    Try this?
    Code:
    Sub selcells()
    Range("D14").Activate
    Do Until ActiveCell.Value = 0
    ActiveCell.Offset(0, 1).Activate
    Loop
    Range(ActiveCell.Offset(-1, 0), "C1").Select
    End Sub
    HTH

  3. #3
    Board Regular
    Join Date
    Nov 2003
    Posts
    159
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Select a Range based on cell value

      
    Thanx this works perfectly, the only change I had to make was the cell offset. From -1, 0 to -1,-1.

    THANXXXXXXX

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
  •  

 

 
DMCA.com