Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Userform - ComboBox fills TextBox not working

Thanks for looking at this.
Form Data:
I have a multipage userform. On page 3, I have a dropdown combobox called
cboAtty that autofills from ROWSOURSE properties =Data!A2:A30 (Sheet Data).
This part works fine.
Also, located on the same form is a TexBox called tbBar:

Data:
On another sheet called Data I have the same info as A2:A30, then in B2:B30
a number associated to each A column data.
Now Back to the Combo Box called cboAtty, I have the following Code that
fails with the message.
Run-time error '-2147352571 (80020005)':
Could not set the Value property. Type mismatch

Private Sub cboAtty_Change()
tbBar.Value = Application.VLookup _
(cboAtty.Value, Sheet1.Range("A2:B30"), 2, False)
End Sub

My Objective is to have the TextBox tbBar to autofill based on my selection
of the DropDown ComboBox called cboAtty.
Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Userform - ComboBox fills TextBox not working

Thom,

I emulated your code and it worked fine for me (in a single and multi-page
userform).

In your note to say the RowSource is in a sheet named Data and then further
on you say there is another sheet named Data - I was slightly confused by
this. In my testing I used the same A2:A30 for both RowSource and VLOOKUP.

I note you reference Sheet1 in you VLOOKUP -is this correct? Should it (does
it) reference the sheet Data?

Your error message suggests (to me) a data mismatch.

Sorry I can't be more helpful.


"thom hoyle" wrote:

Thanks for looking at this.
Form Data:
I have a multipage userform. On page 3, I have a dropdown combobox called
cboAtty that autofills from ROWSOURSE properties =Data!A2:A30 (Sheet Data).
This part works fine.
Also, located on the same form is a TexBox called tbBar:

Data:
On another sheet called Data I have the same info as A2:A30, then in B2:B30
a number associated to each A column data.
Now Back to the Combo Box called cboAtty, I have the following Code that
fails with the message.
Run-time error '-2147352571 (80020005)':
Could not set the Value property. Type mismatch

Private Sub cboAtty_Change()
tbBar.Value = Application.VLookup _
(cboAtty.Value, Sheet1.Range("A2:B30"), 2, False)
End Sub

My Objective is to have the TextBox tbBar to autofill based on my selection
of the DropDown ComboBox called cboAtty.
Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm TextBox/ComboBox question grasping@straws Excel Discussion (Misc queries) 1 February 2nd 05 11:14 AM
combobox/textbox/userform/other question RPIJG[_49_] Excel Programming 1 June 16th 04 07:53 PM
Question about ComboBox/Userform/TextBox etc. RPIJG[_41_] Excel Programming 8 June 16th 04 03:41 PM
Userform: Textbox changing with selection in combobox (list) NorTor[_3_] Excel Programming 3 June 8th 04 10:19 PM
Userform ComboBox and TextBox help!!! Pete Excel Programming 1 February 13th 04 09:13 PM


All times are GMT +1. The time now is 03:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"