Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Spreadsheets (https://www.askmehelpdesk.com/forumdisplay.php?f=395)
-   -   Need VBA beyond my knowledge (https://www.askmehelpdesk.com/showthread.php?t=797749)

  • Jul 27, 2014, 12:21 PM
    dannac
    1 Attachment(s)
    Need VBA beyond my knowledge
    Excel 2003
    Workbook with sheets "Search, A, B, C, etc (through alphabet)
    Sheets a, b, c, etc have a song name in col A, and a letter code in col B.


    Clicking on "search" sheet opens a userform with radio buttons.
    Clicking a radio button puts a letter code value into cell D3 on the "search" sheet.


    I have the above set up and will attach the file.
    ---------------------------------------------------------------------


    VBA would search sheets (a, b, c, etc) col B for the matching code from "search" sheet cell D3.
    Copy the song names with matching code to col A on "search" sheet.


    When a different radio button is selected, it would clear the previous copied song names
    and serach for the new matching code, and copy those songs to the "search" sheet.
  • Jul 27, 2014, 12:45 PM
    ScottGem
    Just a point, Excel is not a database. It can be used to track simple data, but it sounds like you have exceeded the capabilities of Excel in easily tracking data. While I believe you can do what you need using VBA, you can do what you want in Access (a real database) with little if any coding.
  • Jul 28, 2014, 09:31 AM
    dannac
    I do have Access... looked at it once and was rather confused.
    Much rather excel but may have to give it another look.

    Thanks for the reply.
  • Jul 28, 2014, 09:43 AM
    ScottGem
    Access is not an advanced version of Excel. And if you try to look at it that way, you will be confused.

    I took a look at your spreadsheet, So all you have is a single table with title and code. (In Access you would create a lookup table for the codes).

    You could use a multi-value field to select as many songs as you want, then print out a report of the selected songs.
  • Jul 28, 2014, 05:19 PM
    JBeaucaire
    1 Attachment(s)
    I've added the TITLES to every sheet to make the filtering of data clean and simple. Then built a macro into the SEARCH sheet module that will watch for any change in cell D3. If you edit that cell, all the rows from all the sheets with a matching column B value will be collected.
  • Jul 28, 2014, 06:42 PM
    dannac
    JB... thanks for the file.

    Not working as I expected though. It seems to bring all songs in and filters/sorts.

    Only wanted to bring songs that match the key code put in D3 by the radio button selection.

    If I click "Prelude"... only songs that have the key of "P" will be copied to the Search sheet.

    Looked at the code, but did not understand it enough to try and fix.

    Thanks
  • Jul 30, 2014, 01:09 PM
    JBeaucaire
    When I click on the Prelude in your form, it puts a P in D3 which causes all the "P" rows to be copied in from all the other sheets. How is that not what you wanted?
  • Jul 31, 2014, 02:01 AM
    dannac
    Not sure what's going on JB... it does not work that way on my computer.

    Does not matter which radio button is selected, it brings all songs in.

    http://i819.photobucket.com/albums/z...ps5d72277a.jpg


    http://i819.photobucket.com/albums/z...ps501213c9.jpg
  • Jul 31, 2014, 07:50 AM
    JBeaucaire
    Well, that's just odd. I just opened the same file above, working perfectly.

    Video: 2014-07-31_0749 - JerryBeaucaire's library
  • Jul 31, 2014, 08:03 AM
    JBeaucaire
    1 Attachment(s)
    Just shot in the dark silly suggestions, maybe edit this one line of code:

    Code:

    ws.UsedRange.AutoFilter 2, Range("D3").Value
  • Aug 1, 2014, 03:29 AM
    dannac
    Hah... shot in the dark suggestion fixed it. Thanks JB

    Home

  • All times are GMT -7. The time now is 06:35 AM.