+ Reply to Thread
Results 1 to 3 of 3

multiple selection of ranges and remembering them

  1. #1
    Registered User
    Join Date
    06-17-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    1

    multiple selection of ranges and remembering them

    I have a table with 3 columns.

    First two columns contain data that would be used for charting. Third column takes a feedback from user in terms of Yes or No and then depending on their reply uses that row (first two columns of the row) as a part of the chart

    for eg:
    Device type No. Yes/No
    abc 2
    def 2 yes
    ghi 6
    jkl 600 yes
    mno 40
    pqr 400

    Now since the user has selected 'def' and 'jkl' for charting, only those should be charted.

    I have written following code

    For i = 2 To 7 Step 1
    If Range("c" & i).Value = "yes" Then
    Range("a" & i & ":b" & i).Select
    End If
    Next

    but the problem with above code is, it remembers only final selection i.e for 'jkl' and not for 'def' since 'jkl' was selected later. How do I have both ranges selected at a time?

    Any inputs will be of great help

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: multiple selection of ranges and remembering them

    Please use code tags when posting code.

    Please Login or Register  to view this content.
    Simplest thing would be to select all the data for the chart and then use Autofilter.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor starryknight64's Avatar
    Join Date
    09-27-2006
    Location
    Missouri
    MS-Off Ver
    2003 (Work) & 2007 (Home)
    Posts
    193

    Red face Re: multiple selection of ranges and remembering them

    Well, Andy beat me to it (and he used a more elaborate bit of code while he was at it)

    But, I didn't want the fruits of my labor to go spoiled, so here goes:

    Please Login or Register  to view this content.
    starryknight64

+ 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