+ Reply to Thread
Results 1 to 2 of 2

ComboBox Value Comparison from multiple worksheets

  1. #1
    Ed P
    Guest

    ComboBox Value Comparison from multiple worksheets

    I am resubmitting this from early this morning. I posted this at 6:52 PST
    this morning so if someone is working this I apologize.

    Can someone please guide me in the right direction on how I would compare the
    value of comboboxes from multiple sheets.
    I have tried different methods like activating individual sheets but nothing
    has worked.
    The catch here is that the code needs to run automatically and from a
    worksheet that does not contain one of the comboboxes that i am trying to
    compare.
    Any Suggestions?
    Thanks for yuor help
    Ed


  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Ed,

    To compare the values of ComboBoxes on diffrent sheets you need to use a fully qualified object reference. The example below will makes this clear.

    Eample - Compare ComboBox1 Value on "Sheet1" to ComboBox2 Value on "Sheet2"

    If Sheets("Sheet1").ComboBox1.Value = Sheets("Sheet2").ComboBox2.Value Then
    MsgBox "Values are equal"
    Else
    MsgBox "Values are unequal"
    End If

    Prefixing the ComboBox with the sheet name tells VBA which ComboBox you want without having to activate the sheet it is on.

    Hope this helps,
    Leith Ross

+ 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