+ Reply to Thread
Results 1 to 2 of 2

Combobox with autofill across 2 documents

  1. #1
    Registered User
    Join Date
    06-30-2012
    Location
    podgorica
    MS-Off Ver
    Excel 2007
    Posts
    1

    Talking Combobox with autofill across 2 documents

    This is my problem that will, hopefully, get solved here :
    I figured out how to make a combobox which is activated by double click on a field, and which has autofill enabled features. I did that via some VBA programming, and the combobox works only in one document.
    I need to know how to make the combobox(in one .xls file) use data from another .xls file that is opened and is located in the same folder as the .xls file of the combobox.

    Thanks in advance people of excel forums
    PS. If you didn't understand the problem, i will try to, somehow, make it more understanable.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Combobox with autofill across 2 documents

    Just set an object to the other WB, then you can 'handle' it just like any other WB.

    Set CurrWB = Activeworkbook

    But it's even better if you can specify the WB.

    Set SourceWB = Workbooks("Source FIle.xls")

    Then test for your other WB

    On Error Resume Next 'Turn error breaks off
    Set DestWB = Workbooks("Dest File.xls")
    On Error Goto 0 'Turn error breaks on
    If Not DestWB is Not Nothing then

    'do stuff here.

    If you're using selection, try to port over to using ranges. No activation needed!

    HTH
    David
    (*) Reputation points appreciated.

+ 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