+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    11-24-2008
    Location
    Moscow, Russia
    MS-Off Ver
    MS Office 2003, 2007
    Posts
    90

    Userform getting data from Excel table

    Hello, everyone,

    I've got a problem I seem to be unable to solve by myself.

    I've found here a thead with a similar issue, here it is:
    http://www.excelforum.com/excel-prog...-criteria.html

    I've got exactly the same, but the only difference is that I have my userform in a Word document. My userform has a combobox, and textboxes that should return the values from Excel table depending on the user's selection in the combobox.
    I tried to copy the code to my word document, and the problem appears with rng.Find and cl.Offset, and it seems to me that it is because Word treats these variables as word ranges, but not excel ranges. But how should I make this difference when declaring my variables as Range?

    I'll be really grateful for any help.
    Last edited by Freaky_zoid; 04-15-2009 at 02:55 AM.
    Trapped like a tiger in a washing machine

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & read 2007
    Posts
    15,497

    Re: Userform getting data from Excel table

    Hello Freaky_zoid,

    You are right. The ambiguous object name Range is a problem. To correct it, qualify your object reference in the Dim statement with the Parent object's name. In this case, Excel.
    Code:
       Dim xlRng As Excel.Range
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    11-24-2008
    Location
    Moscow, Russia
    MS-Off Ver
    MS Office 2003, 2007
    Posts
    90

    Re: Userform getting data from Excel table

    Leith,
    thank you so much, it works!
    Trapped like a tiger in a washing machine

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.2.0