Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Got it......sorted now.
I checked Combobox1 properties, RowSourse: It was reading: =list!a1:a18 it should be: =list!a1:b18 typing error. Thanks -- capt "Dave Peterson" wrote: That's not it. "UserForm_Initialize" is the name of the procedure that excel looks for when the userform is shown/loaded. You can't change that name. It's just like the worksheet/workbook/application event names. You can't change these, either. But I don't have a guess why the code doesn't work for you. capt wrote: Abit embarassing!! I never indicated what userform it was. In this case "4" Private Sub UserForm4_Initialize() With Me.ComboBox1 .RowSource = Worksheets("list").Range("A1:B18").Address(externa l:=False) .ColumnCount = 2 .BoundColumn = 1 .ColumnWidths = "22;0" 'hide the second column End With End Sub I get a debug warning on the following code when run: Private Sub ComboBox1_Change() With Me.ComboBox1 If .ListIndex < 0 Then Me.TextBox3.Value = "" Else Me.TextBox3.Value = .List(.ListIndex, 1) End If End With End Sub The following line gets high lighted in yellow: Me.TextBox3.Value = .List(.ListIndex, 1) -- capt "Dave Peterson" wrote: None at all. Are you going to share your code and the actual error message that shows up? And what did you do to get the combobox to work? I'm curious why it didn't work before. capt wrote: I have just managed to get the combobox to work, it now shows the list! But running the code I get the Debug warning with the following line high lighted in yellow: Me.TextBox3.Value = .List(.ListIndex, 1) Any ideas Dave? -- capt "capt" wrote: Thanks for getting back to me. Yes I have data down columns A and B -- capt "Dave Peterson" wrote: You sure you have something in A1:B18 of the List worksheet--especially the column A? capt wrote: Sorry dave to get back to you on an old question. I have the following code you sent us last week. Private Sub ComboBox1_Change() With Me.ComboBox1 If .ListIndex < 0 Then Me.TextBox3.Value = "" Else Me.TextBox3.Value = .List(.ListIndex, 1) End If End With End Sub Private Sub UserForm_Initialize() With Me.ComboBox1 .RowSource = Worksheets("list").Range("A1:B18").Address(externa l:=False) .ColumnCount = 2 .BoundColumn = 1 .ColumnWidths = "22;0" 'hide the second column End With End Sub The problem I am having now is when I select the combobox the list does not appear yet I checked all the links but I cant find what is wrong. What am I doing wrong!!!!??? -- capt -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Question for Dave Peterson | Excel Discussion (Misc queries) | |||
Print question - Calling Dave Peterson! | Excel Discussion (Misc queries) | |||
Bernie, Dave, Doug, et. al. - question for you | Excel Discussion (Misc queries) | |||
Dave just one more question | Excel Discussion (Misc queries) | |||
Attn: Dave P. Question re Pix Calls via Macro | Excel Discussion (Misc queries) |