LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default How to make this work??

How can I make this work for 2 comboboxes an the same userform and make it
that is the value from combox('CbxMan').value doesn't match anything in
column 'A' or a new name is typed in it will open a new userform? Here is my
current code.

Private Sub CbxMfg_Change()
Dim sSelected As String
Dim dX As Double, dCount As Double
sSelected = Me.CbxMfg.Value
dCount = 0
For dX = 2 To Worksheets("ProCode").UsedRange.Rows.Count
If Cells(dX, 1).Value = sSelected Then
Me.CbxProd.AddItem Cells(d, 2).Value
dCount = dCount + 1
End If
Next
If Not dCount = 0 Then
FrmManu.Show
Unload Me
End If
End Sub


AND

Private Sub UserForm_Initialize()
Dim coll As Collection
Dim i As Long
Dim itm
'fill coll with values from column A
Set coll = New Collection
On Error Resume Next
For i = 2 To Worksheets("ProCode").UsedRange.Rows.Count
coll.Add Range("A" & i).Value, Range("A" & i).Value
Next i
On Error GoTo 0
For Each itm In coll
Me.CbxMfg.AddItem itm
Next

End Sub
 
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
How do I make this work? Scoober Excel Discussion (Misc queries) 15 February 14th 09 10:01 AM
Looking for a way to make this work. Darryl_Neeley Excel Worksheet Functions 8 September 27th 07 05:06 PM
Make table query will work in datasheet view but will not make tab WildlyHarry Excel Discussion (Misc queries) 0 August 28th 07 03:06 PM
can't make it work, I need help kynhart Excel Worksheet Functions 2 October 19th 05 05:58 AM
Spin button in a work sheet - how do I make it work? [email protected] Excel Worksheet Functions 1 April 7th 05 08:43 PM


All times are GMT +1. The time now is 12:28 PM.

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

About Us

"It's about Microsoft Excel"