+ Reply to Thread
Results 1 to 7 of 7

Button-macro to read ranges of cells and return values of other cells based on results

  1. #1
    Registered User
    Join Date
    10-15-2015
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    83

    Button-macro to read ranges of cells and return values of other cells based on results

    Hey Excel-lent people!

    I've attached a sample spreadsheet. Here's what I'm trying to do.

    Let's say that I click the button labeled "40k thru 50k". Well, I'd like it to return a list of all the cells within ranges D5:D16, F5:F16, H5:H16, K5:K16, M5:M16 and O5:O16 whose values are greater than 40000 and less than 50000, and for each one, I'd like the corresponding index data. So if you click the 40k thru 50k button, you'd get a list like this:

    GE-12-Step 3
    RT-11-Step 2
    RT-12-Step 2
    RT-08-Step 3
    RT-09- Step 3

    I'd like the list to be populated in the sheet, if possible because that will be easier to print each time you run the macro, but a pop-up would also serve this purpose well.

    Thank you guys! This forum is really super mega cool and I like you guys and think most of you are very attractive.
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,157

    Re: Button-macro to read ranges of cells and return values of other cells based on results

    One way...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    10-15-2015
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    83

    Re: Button-macro to read ranges of cells and return values of other cells based on results

    Quote Originally Posted by sintek View Post
    One way...
    Rock on!! It totally works!!

    Anyway, one thing I don't see here is the indicator of where it prints the output. Like, what if I wanted the output list to start in C22 or something?
    Last edited by TnD_Guy; 09-06-2019 at 12:11 PM. Reason: Removed code clutter

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,157

    Re: Button-macro to read ranges of cells and return values of other cells based on results

    No need to quote entire code...Just clutters...

    Cells(2, 17) refers Q2
    change it to cells(22,3) refers C22

  5. #5
    Registered User
    Join Date
    10-15-2015
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    83

    Re: Button-macro to read ranges of cells and return values of other cells based on results

    Quote Originally Posted by sintek View Post
    Cells(2, 17) refers Q2
    change it to cells(22,3) refers C22
    You are a wizard. I'm terrified of your power!!!

    Thank you so much!

  6. #6
    Registered User
    Join Date
    10-15-2015
    Location
    USA
    MS-Off Ver
    MS Office 2013
    Posts
    83

    Re: Button-macro to read ranges of cells and return values of other cells based on results

    Hey there! I'm trying to PM you but I'm having trouble for some reason.

    Anyway, the code is working well, but in my finished product, I'm running into some weird snags. I'm getting an "application-defined or object-defined error" on one line, but only when I run the macro with the range set to certain numbers.

    Can I send you the book?

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Button-macro to read ranges of cells and return values of other cells based on results

    Administrative Note:

    Welcome to the forum.

    We would love to help you with your query; however, it has been brought to our attention the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly.

    Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    HTH
    Regards, Jeff

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How do I return specific results based on information in other cells.
    By bradfordahill in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-01-2018, 06:00 PM
  2. [SOLVED] Copy and paste ranges of cells based on values in column A
    By ajk1789 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2014, 02:04 AM
  3. [SOLVED] Return non-blank cells from range AND ignore cells with only formula w/o results
    By grafitti in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-06-2014, 08:15 AM
  4. fomatting cells based on difference between values of cells two ranges.
    By KATIEexcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2013, 04:08 AM
  5. [SOLVED] Search a range for cells that have values and set value in another cell based on results
    By Catsup in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-25-2013, 04:57 PM
  6. Replies: 1
    Last Post: 08-08-2012, 08:40 PM
  7. [SOLVED] Selecting Ranges Based on Cells with same Values
    By nick_w79 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-17-2012, 04:18 AM

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