+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Cant pass variables properly

  1. #1
    Registered User
    Join Date
    11-30-2011
    Location
    switzerland
    MS-Off Ver
    Excel 2007
    Posts
    7

    Cant pass variables properly

    all,

    Im guessing this is a very simple thing but Im new at writing code for excel and i dont have a manual.

    the situation is this. I have a table I want to filter so that I wind up with one entry displayed. I have a combobox to allow for the user to choose what to filter on. I then want to use a command button to have them actually do the filtering. the thing is I cant get the bloody command button to see the variable like .Value in the combobox.

    I can get it if I call a routine within the combobox but I cant call the command button within that. Im pretty sure I need some sort of global declaration but I cant seem to get it to work.


    Any help would be appreciated.


    regards,
    Pete

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Cant pass variables properly

    Is this in a userform or are these sheet (activeX or form) controls?
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    11-30-2011
    Location
    switzerland
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Cant pass variables properly

    pretty sure the combobox is an activeX one.

    the button is a form control button.

    typing it down make me wonder if there isnt going to be a problem with using the two different ones in one form

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Cant pass variables properly

    grizzlypete44,

    Attached is an example workbook based on the criteria provided. It has an ActiveX ComboBox (drop-down) control, and a Form CommandButton control. The macro assigned to the button is:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-30-2011
    Location
    switzerland
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Cant pass variables properly

    That worked like a champ....thanx

+ 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