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
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 Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Leith,
thank you so much, it works!
Trapped like a tiger in a washing machine
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks