+ Reply to Thread
Results 1 to 5 of 5

Trouble collecting multiple input from Excel ribbon

  1. #1
    Forum Contributor
    Join Date
    06-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    150

    Trouble collecting multiple input from Excel ribbon

    I built an interface for the ribbon where two variables ( a dropdown and a string field) provide the inputs por a query. However, most ribbon actions are 1 to 1 (only a single input before starting the action).

    Please Login or Register  to view this content.
    How can I collect both inputs for my code?

    Thanks....

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

    Re: Trouble collecting multiple input from Excel ribbon

    How do you know when the user has provided both pieces of information?
    They could select a State and then enter the city. Or enter a city and then choose a state.

    Whilst you could run code either on the editbox change or dropdown selection you will not know if the entry is complete.
    You could try running the query with the information you have but that might result in a long delay, if the query takes some time. Or even if quick it could be incorrect data as I'm sure there must be states with the same city names.

    Why not add a button to execute the query?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    06-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    150

    Re: Trouble collecting multiple input from Excel ribbon

    Thanks for your help Andy. I understand your concern.

    My plan was to deal with different scenarios inside the code "WU_CollectData". For example in case the recordset returned blanks, it would provide a "no results found with this criteria" message.

    This application is meant for auditing purposes. It is only used when I find something unusual happening in the data I need to dig deeper into it. The data provided to me comes from multiple users and the file formats vary a lot. I am only interested in the details behind what they give me. This is the reason why I cannot attach a macro button to these files. I am seeking to build a 'floating' solution that I can use with any file.

    To give you more details of some the things I tried:
    1. The sub WU_CollectData called a second sub that placed the state input from the dropdown into a variable. WU_collectData handled the second from the edit box. Finally both inputs went into the query. This gave me an error were it would not allow me to call the subup with the dropdown.
    2. I tried placing both input strings into the iribbon variable declaration. This would also give me an error and it would not run.

    Is there another alternative using the ribbon??????

    I do have the city names that are repeated in different states like you mentioned. However, that logic would be very complex. I would have to make sure that I select the right combination State-City before I run it.

    Thanks for your help again.

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

    Re: Trouble collecting multiple input from Excel ribbon

    This example gathers text and dropdown input and displays message of current values.

    Your code can decided what to do based on the user input.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    06-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    150

    Re: Trouble collecting multiple input from Excel ribbon

    Lovely!!!!! once again, you are the man! Just what I was looking for! Many many many thanks.

+ 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. Collecting input from another tab and reflecting it in base tab and formulating define
    By SAGAR KHOLLAM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2012, 01:37 AM
  2. Ribbon - Multiple xlam adding into single Ribbon tab
    By gooopil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-09-2011, 03:40 PM
  3. Trouble with excel changing data I input
    By WiccanFyir in forum Excel General
    Replies: 2
    Last Post: 05-22-2010, 01:27 AM
  4. Input box not collecting range object
    By cheelie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2007, 08:17 PM
  5. Collecting textbox input within a for loop
    By michaelvogt@cox.net in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2006, 03:10 PM

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