+ Reply to Thread
Results 1 to 8 of 8

making a literal from expression

  1. #1
    Registered User
    Join Date
    11-27-2011
    Location
    CO - Colorado
    MS-Off Ver
    Excel 2010
    Posts
    4

    making a literal from expression

    Hello,

    I was just wondering if anone knew how to make a literal into an expression. In my code I have the name of the ComboBox that needs to change within a loop, however when I use that with the select case, the "UCase" makes it match "combobox#" instead of what it is representing.

    The ComboBoxes are categories; then depending on what category from the combobox is selected the number entered beside it will be added to a variable (such as the first one is restaurants) which is keeping track of the totals.

    Please let me know if anyone has any suggestions. Below I posted my code

    Thanks!


    Please Login or Register  to view this content.
    Last edited by mthayer; 11-27-2011 at 05:26 PM. Reason: code

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: making a literal from expression

    Assuming that your combo boxes are on a user form, you can specify them with the controls property of the form.

    e.g.

    Please Login or Register  to view this content.
    Does this help?
    Martin

  3. #3
    Registered User
    Join Date
    11-27-2011
    Location
    CO - Colorado
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: making a literal from expression

    My comboboxes are actually in my spreadsheet (as an activex control).

    I have my sheet set up so you enter your amounts then choose the category then click done and it populates the totals. Since I am giving the user so many input fields (32 to be exact) I need to find a way to make the loop work. If I copy paste and change each variable it works but that seems silly if there is a way to loop through them all.

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: making a literal from expression

    Try

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-27-2011
    Location
    CO - Colorado
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: making a literal from expression

    that almost worked! that's making the variable be textbox1 but I need it to be combobox1

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: making a literal from expression

    Please Login or Register  to view this content.
    Last edited by shg; 11-27-2011 at 06:07 PM.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    11-27-2011
    Location
    CO - Colorado
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: making a literal from expression

    that worked! thank you!

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: making a literal from expression

    Great! Would you please mark the thread as Solved?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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