Combo Box #4

Hi,

In my userform, i have

Firstname:  <DropdownList>

Question:
1. If I want the value of DropDownList to be read from code, how can I do it
via code by hardcoding the entries in combobox_change() function ?
     Private Sub ComboBox1_Change()
       ....
     End Sub

2. If I want the value of DropDownList to be read from Column A1:A10 (note
there are redundant value, how to avoid ?)
    Example:
    A1: Johnson
    A2: Stephen
    A3: Michael
    A4: Daryl
    A5: Michael
    A6: Johnson
    A7: Rebecca
    A8: Johnson
    A9: Sally
    A10: Sally

    So the drop down list will actually read from A1: A10 and have only
    Johnson
    Stephen
    Michael
    Daryl
    Rebecca
    Sally


3. After I click OK in the userform, how can I pass the selected value to my
module code ?

Please advise. Thanks

Regards,
Magix


0
magix (57)
12/13/2005 3:58:41 PM
excel 39879 articles. 2 followers. Follow

10 Replies
533 Views

Similar Articles

[PageSpeed] 46

1. Me.Combobox1.Value

2. Use a dictionary onject

Dim oDic As Object
Dim i As Long
Dim aItems
    Set oDic = CreateObject("Scripting.Dictionary")
    On Error Resume Next
    For i = 1 To Range("A1").End(xlDown).Row
            oDic.Add Cells(i, "A").Value, Cells(i, "A")
    End With
    On Error GoTo 0

    'trabsefr dictionary to an array
    aItems = oDic.Items
    With Me.combobox1
        .Clear
        For i = 0 To oDic.Count - 1
            .AddItem aItems(i)
        Next
    End With
    Set oDic = Nothing

3. In the OK button click event

    Activesheet.Range("A1").Value = me.Combobox1.Value

-- 
 HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"magix" <magix@asia.com> wrote in message
news:439eefb1$1_1@news.tm.net.my...
> Hi,
>
> In my userform, i have
>
> Firstname:  <DropdownList>
>
> Question:
> 1. If I want the value of DropDownList to be read from code, how can I do
it
> via code by hardcoding the entries in combobox_change() function ?
>      Private Sub ComboBox1_Change()
>        ....
>      End Sub
>
> 2. If I want the value of DropDownList to be read from Column A1:A10 (note
> there are redundant value, how to avoid ?)
>     Example:
>     A1: Johnson
>     A2: Stephen
>     A3: Michael
>     A4: Daryl
>     A5: Michael
>     A6: Johnson
>     A7: Rebecca
>     A8: Johnson
>     A9: Sally
>     A10: Sally
>
>     So the drop down list will actually read from A1: A10 and have only
>     Johnson
>     Stephen
>     Michael
>     Daryl
>     Rebecca
>     Sally
>
>
> 3. After I click OK in the userform, how can I pass the selected value to
my
> module code ?
>
> Please advise. Thanks
>
> Regards,
> Magix
>
>


0
bob.phillips1 (6510)
12/13/2005 4:37:26 PM
Hi Bob,

1. Do you mean I put like this ?
    Private Sub ComboBox1_Change()
       Me.Combobox1.Value = "David"
       Me.Combobox1.Value = "Rebecca"
       Me.Combobox1.Value = "Kenix"
       Me.Combobox1.Value = "Isaac"
    End Sub

2. Where should I put this code that you written ? in "  Private Sub
ComboBox1_Change( )" ?
        Dim oDic As Object
        ...
        ...
        ...
        Set oDic = Nothing

Regards.


"Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
news:OedlNOAAGHA.3064@TK2MSFTNGP10.phx.gbl...
> 1. Me.Combobox1.Value
>
> 2. Use a dictionary onject
>
> Dim oDic As Object
> Dim i As Long
> Dim aItems
>     Set oDic = CreateObject("Scripting.Dictionary")
>     On Error Resume Next
>     For i = 1 To Range("A1").End(xlDown).Row
>             oDic.Add Cells(i, "A").Value, Cells(i, "A")
>     End With
>     On Error GoTo 0
>
>     'trabsefr dictionary to an array
>     aItems = oDic.Items
>     With Me.combobox1
>         .Clear
>         For i = 0 To oDic.Count - 1
>             .AddItem aItems(i)
>         Next
>     End With
>     Set oDic = Nothing
>
> 3. In the OK button click event
>
>     Activesheet.Range("A1").Value = me.Combobox1.Value
>
> -- 
>  HTH
>
> Bob Phillips
>
> (remove nothere from email address if mailing direct)
>
> "magix" <magix@asia.com> wrote in message
> news:439eefb1$1_1@news.tm.net.my...
> > Hi,
> >
> > In my userform, i have
> >
> > Firstname:  <DropdownList>
> >
> > Question:
> > 1. If I want the value of DropDownList to be read from code, how can I
do
> it
> > via code by hardcoding the entries in combobox_change() function ?
> >      Private Sub ComboBox1_Change()
> >        ....
> >      End Sub
> >
> > 2. If I want the value of DropDownList to be read from Column A1:A10
(note
> > there are redundant value, how to avoid ?)
> >     Example:
> >     A1: Johnson
> >     A2: Stephen
> >     A3: Michael
> >     A4: Daryl
> >     A5: Michael
> >     A6: Johnson
> >     A7: Rebecca
> >     A8: Johnson
> >     A9: Sally
> >     A10: Sally
> >
> >     So the drop down list will actually read from A1: A10 and have only
> >     Johnson
> >     Stephen
> >     Michael
> >     Daryl
> >     Rebecca
> >     Sally
> >
> >
> > 3. After I click OK in the userform, how can I pass the selected value
to
> my
> > module code ?
> >
> > Please advise. Thanks
> >
> > Regards,
> > Magix
> >
> >
>
>


0
magix (57)
12/14/2005 3:36:03 PM
1. Why would you want multiple values on the change. What I gave you showed
you how to get the selected value. probably in the click event. If you are
trying to load the combobox. you need

    Me.Combobox1.AddItem "David"

etc., but not in the change event, in the userform ac tivate event.

2. Again in userform activate when you are getting all the values.

-- 
 HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"magix" <magix@asia.com> wrote in message news:43a03be4_2@news.tm.net.my...
> Hi Bob,
>
> 1. Do you mean I put like this ?
>     Private Sub ComboBox1_Change()
>        Me.Combobox1.Value = "David"
>        Me.Combobox1.Value = "Rebecca"
>        Me.Combobox1.Value = "Kenix"
>        Me.Combobox1.Value = "Isaac"
>     End Sub
>
> 2. Where should I put this code that you written ? in "  Private Sub
> ComboBox1_Change( )" ?
>         Dim oDic As Object
>         ...
>         ...
>         ...
>         Set oDic = Nothing
>
> Regards.
>
>
> "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> news:OedlNOAAGHA.3064@TK2MSFTNGP10.phx.gbl...
> > 1. Me.Combobox1.Value
> >
> > 2. Use a dictionary onject
> >
> > Dim oDic As Object
> > Dim i As Long
> > Dim aItems
> >     Set oDic = CreateObject("Scripting.Dictionary")
> >     On Error Resume Next
> >     For i = 1 To Range("A1").End(xlDown).Row
> >             oDic.Add Cells(i, "A").Value, Cells(i, "A")
> >     End With
> >     On Error GoTo 0
> >
> >     'trabsefr dictionary to an array
> >     aItems = oDic.Items
> >     With Me.combobox1
> >         .Clear
> >         For i = 0 To oDic.Count - 1
> >             .AddItem aItems(i)
> >         Next
> >     End With
> >     Set oDic = Nothing
> >
> > 3. In the OK button click event
> >
> >     Activesheet.Range("A1").Value = me.Combobox1.Value
> >
> > -- 
> >  HTH
> >
> > Bob Phillips
> >
> > (remove nothere from email address if mailing direct)
> >
> > "magix" <magix@asia.com> wrote in message
> > news:439eefb1$1_1@news.tm.net.my...
> > > Hi,
> > >
> > > In my userform, i have
> > >
> > > Firstname:  <DropdownList>
> > >
> > > Question:
> > > 1. If I want the value of DropDownList to be read from code, how can I
> do
> > it
> > > via code by hardcoding the entries in combobox_change() function ?
> > >      Private Sub ComboBox1_Change()
> > >        ....
> > >      End Sub
> > >
> > > 2. If I want the value of DropDownList to be read from Column A1:A10
> (note
> > > there are redundant value, how to avoid ?)
> > >     Example:
> > >     A1: Johnson
> > >     A2: Stephen
> > >     A3: Michael
> > >     A4: Daryl
> > >     A5: Michael
> > >     A6: Johnson
> > >     A7: Rebecca
> > >     A8: Johnson
> > >     A9: Sally
> > >     A10: Sally
> > >
> > >     So the drop down list will actually read from A1: A10 and have
only
> > >     Johnson
> > >     Stephen
> > >     Michael
> > >     Daryl
> > >     Rebecca
> > >     Sally
> > >
> > >
> > > 3. After I click OK in the userform, how can I pass the selected value
> to
> > my
> > > module code ?
> > >
> > > Please advise. Thanks
> > >
> > > Regards,
> > > Magix
> > >
> > >
> >
> >
>
>


0
bob.phillips1 (6510)
12/14/2005 4:15:58 PM
Hi Bob,

I tried with your code, and it works.

 > Dim oDic As Object
 > Dim i As Long
 > Dim aItems
 >     Set oDic = CreateObject("Scripting.Dictionary")
 >     On Error Resume Next
 >     For i = 1 To Range("A1").End(xlDown).Row
 >             oDic.Add Cells(i, "A").Value, Cells(i, "A")
 >     Next i
 >     On Error GoTo 0
 >
 >     'trabsefr dictionary to an array
 >     aItems = oDic.Items
 >     With Me.combobox1
 >         .Clear
 >         For i = 0 To oDic.Count - 1
 >             .AddItem aItems(i)
 >         Next
 >     End With
 >     Set oDic = Nothing

How can I modify your code to filter the value that contains certain
substring, which I do not want it to be add into the list ?
Based on my example below: the output should be
     Johnson
     Stephen
     Michael
     Daryl
     Rebecca
     Sally

If I want to add additional filter to filter if the value contains substring
"Reb", it is has "Reb", I will not add it into combo list. So the final list
will be
     Johnson
     Stephen
     Michael
     Daryl
     Sally

Hope you understand what I mean.

Thank you.

Best Regards,
Magix


"Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
news:O5Pq4mMAGHA.2704@TK2MSFTNGP15.phx.gbl...
> 1. Why would you want multiple values on the change. What I gave you
showed
> you how to get the selected value. probably in the click event. If you are
> trying to load the combobox. you need
>
>     Me.Combobox1.AddItem "David"
>
> etc., but not in the change event, in the userform ac tivate event.
>
> 2. Again in userform activate when you are getting all the values.
>
> -- 
>  HTH
>
> Bob Phillips
>
> (remove nothere from email address if mailing direct)
>
> "magix" <magix@asia.com> wrote in message
news:43a03be4_2@news.tm.net.my...
> > Hi Bob,
> >
> > 1. Do you mean I put like this ?
> >     Private Sub ComboBox1_Change()
> >        Me.Combobox1.Value = "David"
> >        Me.Combobox1.Value = "Rebecca"
> >        Me.Combobox1.Value = "Kenix"
> >        Me.Combobox1.Value = "Isaac"
> >     End Sub
> >
> > 2. Where should I put this code that you written ? in "  Private Sub
> > ComboBox1_Change( )" ?
> >         Dim oDic As Object
> >         ...
> >         ...
> >         ...
> >         Set oDic = Nothing
> >
> > Regards.
> >
> >
> > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> > news:OedlNOAAGHA.3064@TK2MSFTNGP10.phx.gbl...
> > > 1. Me.Combobox1.Value
> > >
> > > 2. Use a dictionary onject
> > >
> > > Dim oDic As Object
> > > Dim i As Long
> > > Dim aItems
> > >     Set oDic = CreateObject("Scripting.Dictionary")
> > >     On Error Resume Next
> > >     For i = 1 To Range("A1").End(xlDown).Row
> > >             oDic.Add Cells(i, "A").Value, Cells(i, "A")
> > >     End With
> > >     On Error GoTo 0
> > >
> > >     'trabsefr dictionary to an array
> > >     aItems = oDic.Items
> > >     With Me.combobox1
> > >         .Clear
> > >         For i = 0 To oDic.Count - 1
> > >             .AddItem aItems(i)
> > >         Next
> > >     End With
> > >     Set oDic = Nothing
> > >
> > > 3. In the OK button click event
> > >
> > >     Activesheet.Range("A1").Value = me.Combobox1.Value
> > >
> > > -- 
> > >  HTH
> > >
> > > Bob Phillips
> > >
> > > (remove nothere from email address if mailing direct)
> > >
> > > "magix" <magix@asia.com> wrote in message
> > > news:439eefb1$1_1@news.tm.net.my...
> > > > Hi,
> > > >
> > > > In my userform, i have
> > > >
> > > > Firstname:  <DropdownList>
> > > >
> > > > Question:
> > > > 1. If I want the value of DropDownList to be read from code, how can
I
> > do
> > > it
> > > > via code by hardcoding the entries in combobox_change() function ?
> > > >      Private Sub ComboBox1_Change()
> > > >        ....
> > > >      End Sub
> > > >
> > > > 2. If I want the value of DropDownList to be read from Column A1:A10
> > (note
> > > > there are redundant value, how to avoid ?)
> > > >     Example:
> > > >     A1: Johnson
> > > >     A2: Stephen
> > > >     A3: Michael
> > > >     A4: Daryl
> > > >     A5: Michael
> > > >     A6: Johnson
> > > >     A7: Rebecca
> > > >     A8: Johnson
> > > >     A9: Sally
> > > >     A10: Sally
> > > >
> > > >     So the drop down list will actually read from A1: A10 and have
> only
> > > >     Johnson
> > > >     Stephen
> > > >     Michael
> > > >     Daryl
> > > >     Rebecca
> > > >     Sally
> > > >
> > > >
> > > > 3. After I click OK in the userform, how can I pass the selected
value
> > to
> > > my
> > > > module code ?
> > > >
> > > > Please advise. Thanks
> > > >
> > > > Regards,
> > > > Magix
> > > >
> > > >
> > >
> > >
> >
> >
>
>


0
magix (57)
12/15/2005 3:53:56 PM
Hi Bob,

If I use your dictionary code, then in Change event, how should I do ? is it
like this ? But I think this is not so appropriate.

let say in my combo box, i have list
David
Johnson
Michael

Private Sub ComboBox1_Change()
    Select Case ComboBox1.Text
        Case "David"
           Me.ComboBox1.Value = "David"
        Case "Johnson"
           Me.ComboBox1.Value = "Johnson"
        Case "Michael"
           Me.ComboBox1.Value = "Michael"
        Case Else
    End Select
End Sub

If not, what is the appropriate one, with respect to your dictionary object
?

BestRegards,
Magix

"Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
news:O5Pq4mMAGHA.2704@TK2MSFTNGP15.phx.gbl...
> 1. Why would you want multiple values on the change. What I gave you
showed
> you how to get the selected value. probably in the click event. If you are
> trying to load the combobox. you need
>
>     Me.Combobox1.AddItem "David"
>
> etc., but not in the change event, in the userform ac tivate event.
>
> 2. Again in userform activate when you are getting all the values.
>
> -- 
>  HTH
>
> Bob Phillips
>
> (remove nothere from email address if mailing direct)
>
> "magix" <magix@asia.com> wrote in message
news:43a03be4_2@news.tm.net.my...
> > Hi Bob,
> >
> > 1. Do you mean I put like this ?
> >     Private Sub ComboBox1_Change()
> >        Me.Combobox1.Value = "David"
> >        Me.Combobox1.Value = "Rebecca"
> >        Me.Combobox1.Value = "Kenix"
> >        Me.Combobox1.Value = "Isaac"
> >     End Sub
> >
> > 2. Where should I put this code that you written ? in "  Private Sub
> > ComboBox1_Change( )" ?
> >         Dim oDic As Object
> >         ...
> >         ...
> >         ...
> >         Set oDic = Nothing
> >
> > Regards.
> >
> >
> > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> > news:OedlNOAAGHA.3064@TK2MSFTNGP10.phx.gbl...
> > > 1. Me.Combobox1.Value
> > >
> > > 2. Use a dictionary onject
> > >
> > > Dim oDic As Object
> > > Dim i As Long
> > > Dim aItems
> > >     Set oDic = CreateObject("Scripting.Dictionary")
> > >     On Error Resume Next
> > >     For i = 1 To Range("A1").End(xlDown).Row
> > >             oDic.Add Cells(i, "A").Value, Cells(i, "A")
> > >     End With
> > >     On Error GoTo 0
> > >
> > >     'trabsefr dictionary to an array
> > >     aItems = oDic.Items
> > >     With Me.combobox1
> > >         .Clear
> > >         For i = 0 To oDic.Count - 1
> > >             .AddItem aItems(i)
> > >         Next
> > >     End With
> > >     Set oDic = Nothing
> > >
> > > 3. In the OK button click event
> > >
> > >     Activesheet.Range("A1").Value = me.Combobox1.Value
> > >
> > > -- 
> > >  HTH
> > >
> > > Bob Phillips
> > >
> > > (remove nothere from email address if mailing direct)
> > >
> > > "magix" <magix@asia.com> wrote in message
> > > news:439eefb1$1_1@news.tm.net.my...
> > > > Hi,
> > > >
> > > > In my userform, i have
> > > >
> > > > Firstname:  <DropdownList>
> > > >
> > > > Question:
> > > > 1. If I want the value of DropDownList to be read from code, how can
I
> > do
> > > it
> > > > via code by hardcoding the entries in combobox_change() function ?
> > > >      Private Sub ComboBox1_Change()
> > > >        ....
> > > >      End Sub
> > > >
> > > > 2. If I want the value of DropDownList to be read from Column A1:A10
> > (note
> > > > there are redundant value, how to avoid ?)
> > > >     Example:
> > > >     A1: Johnson
> > > >     A2: Stephen
> > > >     A3: Michael
> > > >     A4: Daryl
> > > >     A5: Michael
> > > >     A6: Johnson
> > > >     A7: Rebecca
> > > >     A8: Johnson
> > > >     A9: Sally
> > > >     A10: Sally
> > > >
> > > >     So the drop down list will actually read from A1: A10 and have
> only
> > > >     Johnson
> > > >     Stephen
> > > >     Michael
> > > >     Daryl
> > > >     Rebecca
> > > >     Sally
> > > >
> > > >
> > > > 3. After I click OK in the userform, how can I pass the selected
value
> > to
> > > my
> > > > module code ?
> > > >
> > > > Please advise. Thanks
> > > >
> > > > Regards,
> > > > Magix
> > > >
> > > >
> > >
> > >
> >
> >
>
>


0
magix (57)
12/15/2005 4:03:30 PM
I think this is what you mean

Dim oDic As Object
Dim i As Long
Dim aItems
    Set oDic = CreateObject("Scripting.Dictionary")
    On Error Resume Next
    For i = 1 To Range("A1").End(xlDown).Row
            If Not Cells(i,"A").Value Like "*Reb*" Then
                oDic.Add Cells(i, "A").Value, Cells(i, "A").Value
            End If
    End With
    On Error GoTo 0

    'transfer dictionary to an array
    aItems = oDic.Items
    With Me.combobox1
        .Clear
        For i = 0 To oDic.Count - 1
            .AddItem aItems(i)
        Next
    End With
    Set oDic = Nothing


-- 
 HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"magix" <magix@asia.com> wrote in message news:43a19196_2@news.tm.net.my...
> Hi Bob,
>
> I tried with your code, and it works.
>
>  > Dim oDic As Object
>  > Dim i As Long
>  > Dim aItems
>  >     Set oDic = CreateObject("Scripting.Dictionary")
>  >     On Error Resume Next
>  >     For i = 1 To Range("A1").End(xlDown).Row
>  >             oDic.Add Cells(i, "A").Value, Cells(i, "A")
>  >     Next i
>  >     On Error GoTo 0
>  >
>  >     'trabsefr dictionary to an array
>  >     aItems = oDic.Items
>  >     With Me.combobox1
>  >         .Clear
>  >         For i = 0 To oDic.Count - 1
>  >             .AddItem aItems(i)
>  >         Next
>  >     End With
>  >     Set oDic = Nothing
>
> How can I modify your code to filter the value that contains certain
> substring, which I do not want it to be add into the list ?
> Based on my example below: the output should be
>      Johnson
>      Stephen
>      Michael
>      Daryl
>      Rebecca
>      Sally
>
> If I want to add additional filter to filter if the value contains
substring
> "Reb", it is has "Reb", I will not add it into combo list. So the final
list
> will be
>      Johnson
>      Stephen
>      Michael
>      Daryl
>      Sally
>
> Hope you understand what I mean.
>
> Thank you.
>
> Best Regards,
> Magix
>
>
> "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> news:O5Pq4mMAGHA.2704@TK2MSFTNGP15.phx.gbl...
> > 1. Why would you want multiple values on the change. What I gave you
> showed
> > you how to get the selected value. probably in the click event. If you
are
> > trying to load the combobox. you need
> >
> >     Me.Combobox1.AddItem "David"
> >
> > etc., but not in the change event, in the userform ac tivate event.
> >
> > 2. Again in userform activate when you are getting all the values.
> >
> > -- 
> >  HTH
> >
> > Bob Phillips
> >
> > (remove nothere from email address if mailing direct)
> >
> > "magix" <magix@asia.com> wrote in message
> news:43a03be4_2@news.tm.net.my...
> > > Hi Bob,
> > >
> > > 1. Do you mean I put like this ?
> > >     Private Sub ComboBox1_Change()
> > >        Me.Combobox1.Value = "David"
> > >        Me.Combobox1.Value = "Rebecca"
> > >        Me.Combobox1.Value = "Kenix"
> > >        Me.Combobox1.Value = "Isaac"
> > >     End Sub
> > >
> > > 2. Where should I put this code that you written ? in "  Private Sub
> > > ComboBox1_Change( )" ?
> > >         Dim oDic As Object
> > >         ...
> > >         ...
> > >         ...
> > >         Set oDic = Nothing
> > >
> > > Regards.
> > >
> > >
> > > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> > > news:OedlNOAAGHA.3064@TK2MSFTNGP10.phx.gbl...
> > > > 1. Me.Combobox1.Value
> > > >
> > > > 2. Use a dictionary onject
> > > >
> > > > Dim oDic As Object
> > > > Dim i As Long
> > > > Dim aItems
> > > >     Set oDic = CreateObject("Scripting.Dictionary")
> > > >     On Error Resume Next
> > > >     For i = 1 To Range("A1").End(xlDown).Row
> > > >             oDic.Add Cells(i, "A").Value, Cells(i, "A")
> > > >     End With
> > > >     On Error GoTo 0
> > > >
> > > >     'trabsefr dictionary to an array
> > > >     aItems = oDic.Items
> > > >     With Me.combobox1
> > > >         .Clear
> > > >         For i = 0 To oDic.Count - 1
> > > >             .AddItem aItems(i)
> > > >         Next
> > > >     End With
> > > >     Set oDic = Nothing
> > > >
> > > > 3. In the OK button click event
> > > >
> > > >     Activesheet.Range("A1").Value = me.Combobox1.Value
> > > >
> > > > -- 
> > > >  HTH
> > > >
> > > > Bob Phillips
> > > >
> > > > (remove nothere from email address if mailing direct)
> > > >
> > > > "magix" <magix@asia.com> wrote in message
> > > > news:439eefb1$1_1@news.tm.net.my...
> > > > > Hi,
> > > > >
> > > > > In my userform, i have
> > > > >
> > > > > Firstname:  <DropdownList>
> > > > >
> > > > > Question:
> > > > > 1. If I want the value of DropDownList to be read from code, how
can
> I
> > > do
> > > > it
> > > > > via code by hardcoding the entries in combobox_change() function ?
> > > > >      Private Sub ComboBox1_Change()
> > > > >        ....
> > > > >      End Sub
> > > > >
> > > > > 2. If I want the value of DropDownList to be read from Column
A1:A10
> > > (note
> > > > > there are redundant value, how to avoid ?)
> > > > >     Example:
> > > > >     A1: Johnson
> > > > >     A2: Stephen
> > > > >     A3: Michael
> > > > >     A4: Daryl
> > > > >     A5: Michael
> > > > >     A6: Johnson
> > > > >     A7: Rebecca
> > > > >     A8: Johnson
> > > > >     A9: Sally
> > > > >     A10: Sally
> > > > >
> > > > >     So the drop down list will actually read from A1: A10 and have
> > only
> > > > >     Johnson
> > > > >     Stephen
> > > > >     Michael
> > > > >     Daryl
> > > > >     Rebecca
> > > > >     Sally
> > > > >
> > > > >
> > > > > 3. After I click OK in the userform, how can I pass the selected
> value
> > > to
> > > > my
> > > > > module code ?
> > > > >
> > > > > Please advise. Thanks
> > > > >
> > > > > Regards,
> > > > > Magix
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


0
bob.phillips1 (6510)
12/15/2005 5:36:58 PM
I really do not understand what you are trying to do here, you test an
object for David, and if true, set it to David!

-- 
 HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"magix" <magix@asia.com> wrote in message
news:43a193d3$1_2@news.tm.net.my...
> Hi Bob,
>
> If I use your dictionary code, then in Change event, how should I do ? is
it
> like this ? But I think this is not so appropriate.
>
> let say in my combo box, i have list
> David
> Johnson
> Michael
>
> Private Sub ComboBox1_Change()
>     Select Case ComboBox1.Text
>         Case "David"
>            Me.ComboBox1.Value = "David"
>         Case "Johnson"
>            Me.ComboBox1.Value = "Johnson"
>         Case "Michael"
>            Me.ComboBox1.Value = "Michael"
>         Case Else
>     End Select
> End Sub
>
> If not, what is the appropriate one, with respect to your dictionary
object
> ?
>
> BestRegards,
> Magix
>
> "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> news:O5Pq4mMAGHA.2704@TK2MSFTNGP15.phx.gbl...
> > 1. Why would you want multiple values on the change. What I gave you
> showed
> > you how to get the selected value. probably in the click event. If you
are
> > trying to load the combobox. you need
> >
> >     Me.Combobox1.AddItem "David"
> >
> > etc., but not in the change event, in the userform ac tivate event.
> >
> > 2. Again in userform activate when you are getting all the values.
> >
> > -- 
> >  HTH
> >
> > Bob Phillips
> >
> > (remove nothere from email address if mailing direct)
> >
> > "magix" <magix@asia.com> wrote in message
> news:43a03be4_2@news.tm.net.my...
> > > Hi Bob,
> > >
> > > 1. Do you mean I put like this ?
> > >     Private Sub ComboBox1_Change()
> > >        Me.Combobox1.Value = "David"
> > >        Me.Combobox1.Value = "Rebecca"
> > >        Me.Combobox1.Value = "Kenix"
> > >        Me.Combobox1.Value = "Isaac"
> > >     End Sub
> > >
> > > 2. Where should I put this code that you written ? in "  Private Sub
> > > ComboBox1_Change( )" ?
> > >         Dim oDic As Object
> > >         ...
> > >         ...
> > >         ...
> > >         Set oDic = Nothing
> > >
> > > Regards.
> > >
> > >
> > > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> > > news:OedlNOAAGHA.3064@TK2MSFTNGP10.phx.gbl...
> > > > 1. Me.Combobox1.Value
> > > >
> > > > 2. Use a dictionary onject
> > > >
> > > > Dim oDic As Object
> > > > Dim i As Long
> > > > Dim aItems
> > > >     Set oDic = CreateObject("Scripting.Dictionary")
> > > >     On Error Resume Next
> > > >     For i = 1 To Range("A1").End(xlDown).Row
> > > >             oDic.Add Cells(i, "A").Value, Cells(i, "A")
> > > >     End With
> > > >     On Error GoTo 0
> > > >
> > > >     'trabsefr dictionary to an array
> > > >     aItems = oDic.Items
> > > >     With Me.combobox1
> > > >         .Clear
> > > >         For i = 0 To oDic.Count - 1
> > > >             .AddItem aItems(i)
> > > >         Next
> > > >     End With
> > > >     Set oDic = Nothing
> > > >
> > > > 3. In the OK button click event
> > > >
> > > >     Activesheet.Range("A1").Value = me.Combobox1.Value
> > > >
> > > > -- 
> > > >  HTH
> > > >
> > > > Bob Phillips
> > > >
> > > > (remove nothere from email address if mailing direct)
> > > >
> > > > "magix" <magix@asia.com> wrote in message
> > > > news:439eefb1$1_1@news.tm.net.my...
> > > > > Hi,
> > > > >
> > > > > In my userform, i have
> > > > >
> > > > > Firstname:  <DropdownList>
> > > > >
> > > > > Question:
> > > > > 1. If I want the value of DropDownList to be read from code, how
can
> I
> > > do
> > > > it
> > > > > via code by hardcoding the entries in combobox_change() function ?
> > > > >      Private Sub ComboBox1_Change()
> > > > >        ....
> > > > >      End Sub
> > > > >
> > > > > 2. If I want the value of DropDownList to be read from Column
A1:A10
> > > (note
> > > > > there are redundant value, how to avoid ?)
> > > > >     Example:
> > > > >     A1: Johnson
> > > > >     A2: Stephen
> > > > >     A3: Michael
> > > > >     A4: Daryl
> > > > >     A5: Michael
> > > > >     A6: Johnson
> > > > >     A7: Rebecca
> > > > >     A8: Johnson
> > > > >     A9: Sally
> > > > >     A10: Sally
> > > > >
> > > > >     So the drop down list will actually read from A1: A10 and have
> > only
> > > > >     Johnson
> > > > >     Stephen
> > > > >     Michael
> > > > >     Daryl
> > > > >     Rebecca
> > > > >     Sally
> > > > >
> > > > >
> > > > > 3. After I click OK in the userform, how can I pass the selected
> value
> > > to
> > > > my
> > > > > module code ?
> > > > >
> > > > > Please advise. Thanks
> > > > >
> > > > > Regards,
> > > > > Magix
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


0
bob.phillips1 (6510)
12/15/2005 5:38:01 PM
"Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
news:OlNzc5ZAGHA.1676@TK2MSFTNGP09.phx.gbl...
> I really do not understand what you are trying to do here, you test an
> object for David, and if true, set it to David!
>
> -- 
>  HTH
>
> Bob Phillips
>
> (remove nothere from email address if mailing direct)
>
> "magix" <magix@asia.com> wrote in message
> news:43a193d3$1_2@news.tm.net.my...
> > Hi Bob,
> >
> > If I use your dictionary code, then in Change event, how should I do ?
is
> it
> > like this ? But I think this is not so appropriate.
> >
> > let say in my combo box, i have list
> > David
> > Johnson
> > Michael
> >
> > Private Sub ComboBox1_Change()
> >     Select Case ComboBox1.Text
> >         Case "David"
> >            Me.ComboBox1.Value = "David"
> >         Case "Johnson"
> >            Me.ComboBox1.Value = "Johnson"
> >         Case "Michael"
> >            Me.ComboBox1.Value = "Michael"
> >         Case Else
> >     End Select
> > End Sub
> >
> > If not, what is the appropriate one, with respect to your dictionary
> object
> > ?
> >
> > BestRegards,
> > Magix
> >
> > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> > news:O5Pq4mMAGHA.2704@TK2MSFTNGP15.phx.gbl...
> > > 1. Why would you want multiple values on the change. What I gave you
> > showed
> > > you how to get the selected value. probably in the click event. If you
> are
> > > trying to load the combobox. you need
> > >
> > >     Me.Combobox1.AddItem "David"
> > >
> > > etc., but not in the change event, in the userform ac tivate event.
> > >
> > > 2. Again in userform activate when you are getting all the values.
> > >
> > > -- 
> > >  HTH
> > >
> > > Bob Phillips
> > >
> > > (remove nothere from email address if mailing direct)
> > >
> > > "magix" <magix@asia.com> wrote in message
> > news:43a03be4_2@news.tm.net.my...
> > > > Hi Bob,
> > > >
> > > > 1. Do you mean I put like this ?
> > > >     Private Sub ComboBox1_Change()
> > > >        Me.Combobox1.Value = "David"
> > > >        Me.Combobox1.Value = "Rebecca"
> > > >        Me.Combobox1.Value = "Kenix"
> > > >        Me.Combobox1.Value = "Isaac"
> > > >     End Sub
> > > >
> > > > 2. Where should I put this code that you written ? in "  Private Sub
> > > > ComboBox1_Change( )" ?
> > > >         Dim oDic As Object
> > > >         ...
> > > >         ...
> > > >         ...
> > > >         Set oDic = Nothing
> > > >
> > > > Regards.
> > > >
> > > >
> > > > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> > > > news:OedlNOAAGHA.3064@TK2MSFTNGP10.phx.gbl...
> > > > > 1. Me.Combobox1.Value
> > > > >
> > > > > 2. Use a dictionary onject
> > > > >
> > > > > Dim oDic As Object
> > > > > Dim i As Long
> > > > > Dim aItems
> > > > >     Set oDic = CreateObject("Scripting.Dictionary")
> > > > >     On Error Resume Next
> > > > >     For i = 1 To Range("A1").End(xlDown).Row
> > > > >             oDic.Add Cells(i, "A").Value, Cells(i, "A")
> > > > >     End With
> > > > >     On Error GoTo 0
> > > > >
> > > > >     'trabsefr dictionary to an array
> > > > >     aItems = oDic.Items
> > > > >     With Me.combobox1
> > > > >         .Clear
> > > > >         For i = 0 To oDic.Count - 1
> > > > >             .AddItem aItems(i)
> > > > >         Next
> > > > >     End With
> > > > >     Set oDic = Nothing
> > > > >
> > > > > 3. In the OK button click event
> > > > >
> > > > >     Activesheet.Range("A1").Value = me.Combobox1.Value
> > > > >
> > > > > -- 
> > > > >  HTH
> > > > >
> > > > > Bob Phillips
> > > > >
> > > > > (remove nothere from email address if mailing direct)
> > > > >
> > > > > "magix" <magix@asia.com> wrote in message
> > > > > news:439eefb1$1_1@news.tm.net.my...
> > > > > > Hi,
> > > > > >
> > > > > > In my userform, i have
> > > > > >
> > > > > > Firstname:  <DropdownList>
> > > > > >
> > > > > > Question:
> > > > > > 1. If I want the value of DropDownList to be read from code, how
> can
> > I
> > > > do
> > > > > it
> > > > > > via code by hardcoding the entries in combobox_change() function
?
> > > > > >      Private Sub ComboBox1_Change()
> > > > > >        ....
> > > > > >      End Sub
> > > > > >
> > > > > > 2. If I want the value of DropDownList to be read from Column
> A1:A10
> > > > (note
> > > > > > there are redundant value, how to avoid ?)
> > > > > >     Example:
> > > > > >     A1: Johnson
> > > > > >     A2: Stephen
> > > > > >     A3: Michael
> > > > > >     A4: Daryl
> > > > > >     A5: Michael
> > > > > >     A6: Johnson
> > > > > >     A7: Rebecca
> > > > > >     A8: Johnson
> > > > > >     A9: Sally
> > > > > >     A10: Sally
> > > > > >
> > > > > >     So the drop down list will actually read from A1: A10 and
have
> > > only
> > > > > >     Johnson
> > > > > >     Stephen
> > > > > >     Michael
> > > > > >     Daryl
> > > > > >     Rebecca
> > > > > >     Sally
> > > > > >
> > > > > >
> > > > > > 3. After I click OK in the userform, how can I pass the selected
> > value
> > > > to
> > > > > my
> > > > > > module code ?
> > > > > >
> > > > > > Please advise. Thanks
> > > > > >
> > > > > > Regards,
> > > > > > Magix
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


0
magix (57)
12/16/2005 1:30:23 PM
So usually, what is the common coding in change event ?

"Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
news:OlNzc5ZAGHA.1676@TK2MSFTNGP09.phx.gbl...
> I really do not understand what you are trying to do here, you test an
> object for David, and if true, set it to David!
>
> -- 
>  HTH
>
> Bob Phillips
>
> (remove nothere from email address if mailing direct)
>
> "magix" <magix@asia.com> wrote in message
> news:43a193d3$1_2@news.tm.net.my...
> > Hi Bob,
> >
> > If I use your dictionary code, then in Change event, how should I do ?
is
> it
> > like this ? But I think this is not so appropriate.
> >
> > let say in my combo box, i have list
> > David
> > Johnson
> > Michael
> >
> > Private Sub ComboBox1_Change()
> >     Select Case ComboBox1.Text
> >         Case "David"
> >            Me.ComboBox1.Value = "David"
> >         Case "Johnson"
> >            Me.ComboBox1.Value = "Johnson"
> >         Case "Michael"
> >            Me.ComboBox1.Value = "Michael"
> >         Case Else
> >     End Select
> > End Sub
> >
> > If not, what is the appropriate one, with respect to your dictionary
> object
> > ?
> >
> > BestRegards,
> > Magix
> >
> > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> > news:O5Pq4mMAGHA.2704@TK2MSFTNGP15.phx.gbl...
> > > 1. Why would you want multiple values on the change. What I gave you
> > showed
> > > you how to get the selected value. probably in the click event. If you
> are
> > > trying to load the combobox. you need
> > >
> > >     Me.Combobox1.AddItem "David"
> > >
> > > etc., but not in the change event, in the userform ac tivate event.
> > >
> > > 2. Again in userform activate when you are getting all the values.
> > >
> > > -- 
> > >  HTH
> > >
> > > Bob Phillips
> > >
> > > (remove nothere from email address if mailing direct)
> > >
> > > "magix" <magix@asia.com> wrote in message
> > news:43a03be4_2@news.tm.net.my...
> > > > Hi Bob,
> > > >
> > > > 1. Do you mean I put like this ?
> > > >     Private Sub ComboBox1_Change()
> > > >        Me.Combobox1.Value = "David"
> > > >        Me.Combobox1.Value = "Rebecca"
> > > >        Me.Combobox1.Value = "Kenix"
> > > >        Me.Combobox1.Value = "Isaac"
> > > >     End Sub
> > > >
> > > > 2. Where should I put this code that you written ? in "  Private Sub
> > > > ComboBox1_Change( )" ?
> > > >         Dim oDic As Object
> > > >         ...
> > > >         ...
> > > >         ...
> > > >         Set oDic = Nothing
> > > >
> > > > Regards.
> > > >
> > > >
> > > > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> > > > news:OedlNOAAGHA.3064@TK2MSFTNGP10.phx.gbl...
> > > > > 1. Me.Combobox1.Value
> > > > >
> > > > > 2. Use a dictionary onject
> > > > >
> > > > > Dim oDic As Object
> > > > > Dim i As Long
> > > > > Dim aItems
> > > > >     Set oDic = CreateObject("Scripting.Dictionary")
> > > > >     On Error Resume Next
> > > > >     For i = 1 To Range("A1").End(xlDown).Row
> > > > >             oDic.Add Cells(i, "A").Value, Cells(i, "A")
> > > > >     End With
> > > > >     On Error GoTo 0
> > > > >
> > > > >     'trabsefr dictionary to an array
> > > > >     aItems = oDic.Items
> > > > >     With Me.combobox1
> > > > >         .Clear
> > > > >         For i = 0 To oDic.Count - 1
> > > > >             .AddItem aItems(i)
> > > > >         Next
> > > > >     End With
> > > > >     Set oDic = Nothing
> > > > >
> > > > > 3. In the OK button click event
> > > > >
> > > > >     Activesheet.Range("A1").Value = me.Combobox1.Value
> > > > >
> > > > > -- 
> > > > >  HTH
> > > > >
> > > > > Bob Phillips
> > > > >
> > > > > (remove nothere from email address if mailing direct)
> > > > >
> > > > > "magix" <magix@asia.com> wrote in message
> > > > > news:439eefb1$1_1@news.tm.net.my...
> > > > > > Hi,
> > > > > >
> > > > > > In my userform, i have
> > > > > >
> > > > > > Firstname:  <DropdownList>
> > > > > >
> > > > > > Question:
> > > > > > 1. If I want the value of DropDownList to be read from code, how
> can
> > I
> > > > do
> > > > > it
> > > > > > via code by hardcoding the entries in combobox_change() function
?
> > > > > >      Private Sub ComboBox1_Change()
> > > > > >        ....
> > > > > >      End Sub
> > > > > >
> > > > > > 2. If I want the value of DropDownList to be read from Column
> A1:A10
> > > > (note
> > > > > > there are redundant value, how to avoid ?)
> > > > > >     Example:
> > > > > >     A1: Johnson
> > > > > >     A2: Stephen
> > > > > >     A3: Michael
> > > > > >     A4: Daryl
> > > > > >     A5: Michael
> > > > > >     A6: Johnson
> > > > > >     A7: Rebecca
> > > > > >     A8: Johnson
> > > > > >     A9: Sally
> > > > > >     A10: Sally
> > > > > >
> > > > > >     So the drop down list will actually read from A1: A10 and
have
> > > only
> > > > > >     Johnson
> > > > > >     Stephen
> > > > > >     Michael
> > > > > >     Daryl
> > > > > >     Rebecca
> > > > > >     Sally
> > > > > >
> > > > > >
> > > > > > 3. After I click OK in the userform, how can I pass the selected
> > value
> > > > to
> > > > > my
> > > > > > module code ?
> > > > > >
> > > > > > Please advise. Thanks
> > > > > >
> > > > > > Regards,
> > > > > > Magix
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


0
magix (57)
12/16/2005 1:30:54 PM
You get the changed value, and you process it in some way, which only you
can say what that should be.

-- 
 HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"magix" <magix@asia.com> wrote in message news:43a2c18f_2@news.tm.net.my...
> So usually, what is the common coding in change event ?
>
> "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> news:OlNzc5ZAGHA.1676@TK2MSFTNGP09.phx.gbl...
> > I really do not understand what you are trying to do here, you test an
> > object for David, and if true, set it to David!
> >
> > -- 
> >  HTH
> >
> > Bob Phillips
> >
> > (remove nothere from email address if mailing direct)
> >
> > "magix" <magix@asia.com> wrote in message
> > news:43a193d3$1_2@news.tm.net.my...
> > > Hi Bob,
> > >
> > > If I use your dictionary code, then in Change event, how should I do ?
> is
> > it
> > > like this ? But I think this is not so appropriate.
> > >
> > > let say in my combo box, i have list
> > > David
> > > Johnson
> > > Michael
> > >
> > > Private Sub ComboBox1_Change()
> > >     Select Case ComboBox1.Text
> > >         Case "David"
> > >            Me.ComboBox1.Value = "David"
> > >         Case "Johnson"
> > >            Me.ComboBox1.Value = "Johnson"
> > >         Case "Michael"
> > >            Me.ComboBox1.Value = "Michael"
> > >         Case Else
> > >     End Select
> > > End Sub
> > >
> > > If not, what is the appropriate one, with respect to your dictionary
> > object
> > > ?
> > >
> > > BestRegards,
> > > Magix
> > >
> > > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> > > news:O5Pq4mMAGHA.2704@TK2MSFTNGP15.phx.gbl...
> > > > 1. Why would you want multiple values on the change. What I gave you
> > > showed
> > > > you how to get the selected value. probably in the click event. If
you
> > are
> > > > trying to load the combobox. you need
> > > >
> > > >     Me.Combobox1.AddItem "David"
> > > >
> > > > etc., but not in the change event, in the userform ac tivate event.
> > > >
> > > > 2. Again in userform activate when you are getting all the values.
> > > >
> > > > -- 
> > > >  HTH
> > > >
> > > > Bob Phillips
> > > >
> > > > (remove nothere from email address if mailing direct)
> > > >
> > > > "magix" <magix@asia.com> wrote in message
> > > news:43a03be4_2@news.tm.net.my...
> > > > > Hi Bob,
> > > > >
> > > > > 1. Do you mean I put like this ?
> > > > >     Private Sub ComboBox1_Change()
> > > > >        Me.Combobox1.Value = "David"
> > > > >        Me.Combobox1.Value = "Rebecca"
> > > > >        Me.Combobox1.Value = "Kenix"
> > > > >        Me.Combobox1.Value = "Isaac"
> > > > >     End Sub
> > > > >
> > > > > 2. Where should I put this code that you written ? in "  Private
Sub
> > > > > ComboBox1_Change( )" ?
> > > > >         Dim oDic As Object
> > > > >         ...
> > > > >         ...
> > > > >         ...
> > > > >         Set oDic = Nothing
> > > > >
> > > > > Regards.
> > > > >
> > > > >
> > > > > "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in
message
> > > > > news:OedlNOAAGHA.3064@TK2MSFTNGP10.phx.gbl...
> > > > > > 1. Me.Combobox1.Value
> > > > > >
> > > > > > 2. Use a dictionary onject
> > > > > >
> > > > > > Dim oDic As Object
> > > > > > Dim i As Long
> > > > > > Dim aItems
> > > > > >     Set oDic = CreateObject("Scripting.Dictionary")
> > > > > >     On Error Resume Next
> > > > > >     For i = 1 To Range("A1").End(xlDown).Row
> > > > > >             oDic.Add Cells(i, "A").Value, Cells(i, "A")
> > > > > >     End With
> > > > > >     On Error GoTo 0
> > > > > >
> > > > > >     'trabsefr dictionary to an array
> > > > > >     aItems = oDic.Items
> > > > > >     With Me.combobox1
> > > > > >         .Clear
> > > > > >         For i = 0 To oDic.Count - 1
> > > > > >             .AddItem aItems(i)
> > > > > >         Next
> > > > > >     End With
> > > > > >     Set oDic = Nothing
> > > > > >
> > > > > > 3. In the OK button click event
> > > > > >
> > > > > >     Activesheet.Range("A1").Value = me.Combobox1.Value
> > > > > >
> > > > > > -- 
> > > > > >  HTH
> > > > > >
> > > > > > Bob Phillips
> > > > > >
> > > > > > (remove nothere from email address if mailing direct)
> > > > > >
> > > > > > "magix" <magix@asia.com> wrote in message
> > > > > > news:439eefb1$1_1@news.tm.net.my...
> > > > > > > Hi,
> > > > > > >
> > > > > > > In my userform, i have
> > > > > > >
> > > > > > > Firstname:  <DropdownList>
> > > > > > >
> > > > > > > Question:
> > > > > > > 1. If I want the value of DropDownList to be read from code,
how
> > can
> > > I
> > > > > do
> > > > > > it
> > > > > > > via code by hardcoding the entries in combobox_change()
function
> ?
> > > > > > >      Private Sub ComboBox1_Change()
> > > > > > >        ....
> > > > > > >      End Sub
> > > > > > >
> > > > > > > 2. If I want the value of DropDownList to be read from Column
> > A1:A10
> > > > > (note
> > > > > > > there are redundant value, how to avoid ?)
> > > > > > >     Example:
> > > > > > >     A1: Johnson
> > > > > > >     A2: Stephen
> > > > > > >     A3: Michael
> > > > > > >     A4: Daryl
> > > > > > >     A5: Michael
> > > > > > >     A6: Johnson
> > > > > > >     A7: Rebecca
> > > > > > >     A8: Johnson
> > > > > > >     A9: Sally
> > > > > > >     A10: Sally
> > > > > > >
> > > > > > >     So the drop down list will actually read from A1: A10 and
> have
> > > > only
> > > > > > >     Johnson
> > > > > > >     Stephen
> > > > > > >     Michael
> > > > > > >     Daryl
> > > > > > >     Rebecca
> > > > > > >     Sally
> > > > > > >
> > > > > > >
> > > > > > > 3. After I click OK in the userform, how can I pass the
selected
> > > value
> > > > > to
> > > > > > my
> > > > > > > module code ?
> > > > > > >
> > > > > > > Please advise. Thanks
> > > > > > >
> > > > > > > Regards,
> > > > > > > Magix
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


0
bob.phillips1 (6510)
12/21/2005 8:20:58 PM
Reply:

Similar Artilces:

Microsoft Publisher 2003 #4
I had to reinstall my Microsoft Office 2003 Professional after a computer "crash". When trying to access invoices created in Publisher I get the dialog box that states "Publisher has experienced an error" and then closes. The same thing happens each time I attempt to open any invoice created in Publisher. I went as far as to re-create an invoice in Publisher; after saving and closing then trying to open the same error appears. What could be the problem? Other publisher files open with no problem. -- Karen Does your error message have a details button? What does ...

List box
I am trying to use the list box function from the control toolbar. I am not sure how to get the listings I want in the list box. Is there certain VB coding that is needed? Any help will be appreciated. Thanks. Todd No VBA code needed. In Design mode, click on your list box and select Properties from the Control toolbox (or right-click your list box and select Properties), then scroll down to the ListFillRange Property and indicate the cell range address that has the items you want to appear in the box (i.e., A1:A10). Then exit out of design mode and test your list box. MRO "Tod...

how do i view different mail boxes
I have set up different email accounts in outlook 2000. How do I choose which mail box I view when I go to outlook? btoonhoule <btoonhoule@discussions.microsoft.com> wrote: > I have set up different email accounts in outlook 2000. How do I > choose which mail box I view when I go to outlook? Using IMO or C/W mode? -- Brian Tillman ...

Concatenate Multi-Select List Box Items
I need to use the chosen items in a multi-select List Box as concatenated text in another control on a subform. This text will be part of a large amount of concatenated text. How do I do this? I did find info here about using such items in a query but it was way over my head and I couldn't figure out how to convert that idea to this issue so please don't just refer me to that w/o some other explanation for this novice. For example, if the user selects: Frt Bumper, Grille, & Headlamp in the List Box, I want to then somehow concatenate those selections into a sente...

Filtering a combo box using a combo box
All, I am trying to filter the records from a table displayed in a combo box using a combo box on the same form. I built a query and set the criteria as Me![FormName]![Combo_box]. This allowed me to filter the list, but it did not do exactly what I wanted. When the first combo box is blank, the second one is also blank. Is there anyway I can get the second combo box to display all of the records when the first box is blank? Thank you for your help. Regards, John Try a criteria in the second combo of: Like Forms!YourFormName!Combo1Name & "*" -- Arvin Meyer, MCP, MVP http:/...

colour change of dated box
How can I change the colour of a dated box of excel after the date is over. I want the programme to read date automatically from pc and change colour. try Conditional Formatting In 2003: 1. Select the cells you want to format 2. Choose Format, Conditional Formatting 3. Choose Cell Value Is from the first drop down 3. Choose Formula is from the first drop down 4. Choose less than 5. In the third box, enter =TODAY() 6. Click the Format button 7. Choose a color on the Patterns tab (or any available option) 7. Click OK twice. -- Hope this is helpful Appreciate that you provide your feedbac...

Combo Box on Forms
Hi, I am using a combo box on a form that has several items w/ one being Other. If the user selects other I want them to be able to input what they want so that it will go into the table instead of just the "Other". I just am not really sure on how to do that. Can you help? Thanks, Jaime In design view click on VIEW - Properties and the the combo. Then change Limit To List to No. -- KARL DEWEY Build a little - Test a little "jseger22@yahoo.com" wrote: > Hi, > > I am using a combo box on a form that has several items w/ one being > Other. If the use...

sent box
how do i get the emails in the sent box to show sent to instead of sent from? -- deb deb wrote: > how do i get the emails in the sent box to show sent to instead of sent from? Add/remove whatever columns you want. Right-click on the header row and select Field Chooser. i may have not explained myself too well i dont want to sort by the "to" column i want the header on the email to show "to" not "from" i think the problem might be that this is not the default sent file, its just a folder named "sent" its for my boss, he ha...

convert number to text #4
How can i convert a number to text format without then editing that cell to force the cell to except the format change. I need a numbers to convert to text because a download from another program is already in text format with SS# in the cell. Then using at templet sheet with a VLook Up formula to pull information off the first workbook. To convert number to text, select the area you want to convert, right-click on format cells and choose "text". "RayG" wrote: > How can i convert a number to text format without then editing that cell to > force the cell to ex...

Combo Boxes
Someone sent me an Excel document where each of the cells in I1:I312 are combo boxes. When you click off of those cells, the down arrow disappears. The list for the combo boxes are cells AA1 and AB1 (AA1 is New and AB1 is Existing). Please explain how this was done? Also, can you please tell me if it is possible to make New and Existing autocorrect entries. So even though the choices are New and Existing, if you hit N, New appears, and if you hit E, Existing appears. Thanks!! It sounds like Data|Validation. Take a look at Debra Dalgleish's site: http://www.contextures.com/xlDataVa...

Separator in combo box
hi, Is it possible to have a line separator in a combo box? I mean something like a separator in menus? thanks, Behzad Try :- http://www.codeproject.com/combobox/zsepcmb.asp http://www.codeproject.com/combobox/customcombo.asp -- Regards, Nish [VC++ MVP] http://www.voidnish.com /* MVP tips tricks and essays web site */ http://blog.voidnish.com /* My blog on C++/CLI, MFC, Whidbey, CLR... */ "behzad" <b@b.com> wrote in message news:%23fVB3em5EHA.3368@TK2MSFTNGP10.phx.gbl... > hi, > Is it possible to have a line separator in a combo box? I mean something > like...

Edit box should support languages like japanese,chineese etc
Hi wht im trying to ask is.. 1. In my application, all the labels r in english only. 2.If i change the content of one text box in japanese or chineese language , [Text box value is the title for another dialog] 4.After i changed the content, i want the title to be displayed in japanese or chineese language. Note: I want only that text box to be changed ,,not the entire application.. so How can i able to support multibyte characters in MFC controls CEdit --text boxes.. Plz reply They do. You have to be in a Unicode app, and you have to have selected a Unicode font that has Chin...

Text boxes on graphs
How do you make a text box hide the grid lines behind it on a graph? The grid lines are still visible and run through the text box, cluttering it up. Thanks right-click text box choose -- 'Format Text Box' from shortcut menu colors and lines tab change fill color to white Warm Regards, Crystal remote programming and training Access Basics 8-part free tutorial that covers essentials in Access http://www.AccessMVP.com/strive4peace * (: have an awesome day :) * Drew wrote: > How do you make a text box hide the grid lines behind it on a graph? The > grid line...

Multiple Combo Boxes Highlighted
Hi, I have a problem with something in VB6. I have 4 combo boxes with individual names (not an array) located on an SSTab object. When I select another tab and then return to the tab these boxes are located on, each of them appears to be highlighted in blue. I add values to them only when loading the form so I'm at a loss as to why this happens ? Any ideas are greatly appreciated. Thanks, Jen. "Jennifer Ward" <jward@comcast.net> wrote in message news:eq5HrcBrKHA.6064@TK2MSFTNGP02.phx.gbl... > Hi, > > I have a problem with someth...

HELP !! Combo box to feed other combo boxes
Hi, I have a form with a stock list. One field is [Dealer Allocated] so stock can be allocated to a specific dealer - this is a combo box (combo1) for single allocations. I now also want to be able to update this combo box for several records in bulk. I thought I would do this by having a second combo box in the footer of the form which the user selects the dealer from and then clicks a button which looks for first record without dealer allocated and updates the value of combo1 to the value of combo2. This would then be enclosed in a Do Loop for specified number of records. I can...

Set Text Box Control To Blank
I have a procedure that executes on the beforeupdate event of a textbox (text24). The procedure works out the checkdigit for the number entered and if there is a discrepancy, a message box appears telling the user the number is wrong. What I'd like to do is modify the code as such so that when a discrepancy is found and the user clicks ok on the message box, focus is returned to (text24) and set to blank so that the faulty number is gone. Here is the code I am using.... It's quite crude as I'm only at beginner level, but hey, it works! Private Sub Text24_BeforeUpdate(Cancel As Int...

Outlook issue #4
Hello, In need of some help. Installed new memory and now Outlook 2002 is asking to be re-activated... during install process wants CD.. do not have , and can not find supporting files. Tried looking on orriginal OS (ME) not there , also looked on current OS upgrade XP not there... not sure what to do , can not get help from Microsoft site... any sugestions Put in your Office CD when requested. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be de...

text box margin settings
I've changed the text box margins, saved the file and closed the file. But when I reopen the file, the changes are not there. What gives?!? don The text box margins in an EXISTING text box have changed? Brian Kvalheim Microsoft Publisher MVP http://www.kvalheim.org >-----Original Message----- >I've changed the text box margins, saved the file and >closed the file. But when I reopen the file, the changes >are not there. What gives?!? > >don >. > This issue is unknown in Publisher any version. If you mean it is not saving the defaults on next Text F...

Flag box
Is it possible to add some flagbox in a column? How? Thanks Rossella Depends on what you mean by a flagbox. If you mean some sort of indicator, you could put Y or N in a column (X or leave empty??) and use data|filter|autofilter to "flag" certain entries. Rossella wrote: > > Is it possible to add some flagbox in a column? > How? > Thanks > Rossella -- Dave Peterson I meant the square with the x on it ..sorry if my explanation wasn't enough I find this technique pretty easy... Select the range Format|cells|number tab|custom category In the "type:&qu...

Populate field based on combo box
I know this shouldn't be so hard - but I'm having a brain ... or something! On a form, I would like to select a District Number from a combo box and have the District Name appear in a text field. My form is based on a query. I know somehow I need to add criteria to my query to point to the info in the combo box but I'm not sure exactly where to put this criteria. Should the combo box field for the District Number on the form be based on the Districts table or is this the field that comes from the query? Or is it the District Name field that comes from the query? I have neve...

combo
have placed a subform, which gives the Price. It is based on the Query. I have given a criteria in the query like [forms]![mainform]![productid]. So, when I select a product from a combo box, on the main form, I should see the price on the subform. The problem, is it does not refresh. It still shows the same price for the earlier product. But, when I move, it gets refreshed. Can I have a code , so that I should see the price as soon as I select the product from the combo box . On the After Update event of your combo box put the following: [Forms]![frmMainForm]![sfrmSubfo...

Migrating Attachments in CRM 4.0 #2
Hi, We are using the Data Migration Manager to import data into CRM 4.0. All of our data seems to be migrating fine except for attachments. We have followed all the steps in the help files including: 1)We put all the notes/attachments into a Notes.csv file with a column specifying the entity, a column that contains the unique (entity) id, and a column with the filename. 2)We moved all of the attachments to a sub-folder named 'Attachments' within the folder that is holding the Notes.csv file. 3)We have mapped the 'Regarding' field (in CRM) to the entity id column. Afte...

combo box
Hi: I have a combobox which shows two values: name and age, after I choose "the value", the combo box just shows the "name". I need to be able to print both values. How can I tell the combo box to leave the 2 fields onscreen? Hello Gabito, You can only display one column in the Combo Box. Is this Combo Box on a worksheet? If so, the TextColumn is the one that is displayed and the BoundColumn is the value returned by the combo box. You could make the TextColumn 1 (Name) and the BoundColumn 2 (Age). Then set the Linked cell to an adjacent cell just to the ri...

Combo Box Selection 06-18-07
I have a form that has 3 subforms. The main form has a combobox with selection for Groups. According to the selection of the Group - the subforms should show info for that group. In the Second Subform - this shows Group Details - there is a combo box for Section - where stock from the group will get transferred to the selected section. The choice for Section here should also show in the next subform.ComboBox Section. As inthe next subform this shows Section Details. At the moment - the Section Selection in SectionDetails subform is not updating the value that has been selected. Please hel...

CRM 4 Outlook Client
Hello, We have tried installing the Outlook Client on a number of workstatons. All without success. The workstations have been eith XP or Vista 32 bit with Outlook 2007. We enable the client is enabled using the configuration tool. Next time Outlook is opened it shuts almost immediately. If we diable the client Outlook operates normally again. We get the follwoing in the Application event log on the client: ..NET Runtime version 2.0.50727.312 - Fatal Execution Engine Error (79FF29A7) (80131506) Any suggestions? Many thanks, Marcus Robinson -- MR ICT Ltd - http://www.mrict.co.uk ...