ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MatchEntry for combobox added during runtime (https://www.excelbanter.com/excel-programming/342651-matchentry-combobox-added-during-runtime.html)

Claus[_3_]

MatchEntry for combobox added during runtime
 
Hi,

I hope one of you Gurus can help me on this one.

How can i set MatchEntry for this combobox ?

KontrolNavn = "Kontrol" & X + 1
Set mycmd = UserForm2.Controls.Add("Forms.combobox.1", KontrolNavn,
True)
With mycmd
.Left = 170
.Top = 5 + X * 20
.Width = 100
.RowSource = Cells(Target.Row + X + 1, 4).Value
.Value = Cells(Target.Row + X + 1, Target.Column).Value
End With


Regards

Claus



Patrick Molloy[_2_]

MatchEntry for combobox added during runtime
 
in teh code below, I removed your lines to make the additions a bit
clearer...I hope!

Dim mycmd As ComboBox

Set mycmd = _
UserForm2.Controls.Add("Forms.combobox.1", KontrolNavn, True)
With mycmd

.MatchEntry = fmMatchEntryComplete
End With


"Claus" wrote:

Hi,

I hope one of you Gurus can help me on this one.

How can i set MatchEntry for this combobox ?

KontrolNavn = "Kontrol" & X + 1
Set mycmd = UserForm2.Controls.Add("Forms.combobox.1", KontrolNavn,
True)
With mycmd
.Left = 170
.Top = 5 + X * 20
.Width = 100
.RowSource = Cells(Target.Row + X + 1, 4).Value
.Value = Cells(Target.Row + X + 1, Target.Column).Value
End With


Regards

Claus




Claus[_3_]

MatchEntry for combobox added during runtime
 
Hi Patrick

Sorry i was'ent expressing myself clearly, but i've triede this and it
did'nt work.

Claus
"Patrick Molloy" skrev i en
meddelelse ...
in teh code below, I removed your lines to make the additions a bit
clearer...I hope!

Dim mycmd As ComboBox

Set mycmd = _
UserForm2.Controls.Add("Forms.combobox.1", KontrolNavn, True)
With mycmd

.MatchEntry = fmMatchEntryComplete
End With


"Claus" wrote:

Hi,

I hope one of you Gurus can help me on this one.

How can i set MatchEntry for this combobox ?

KontrolNavn = "Kontrol" & X + 1
Set mycmd = UserForm2.Controls.Add("Forms.combobox.1",
KontrolNavn,
True)
With mycmd
.Left = 170
.Top = 5 + X * 20
.Width = 100
.RowSource = Cells(Target.Row + X + 1, 4).Value
.Value = Cells(Target.Row + X + 1, Target.Column).Value
End With


Regards

Claus






Claus[_3_]

MatchEntry for combobox added during runtime
 
Sorry Patrick

It works.

I'm using the wrong property, i need to make sure that the user only can
select a listitem and type something else.

Claus
"Patrick Molloy" skrev i en
meddelelse ...
in teh code below, I removed your lines to make the additions a bit
clearer...I hope!

Dim mycmd As ComboBox

Set mycmd = _
UserForm2.Controls.Add("Forms.combobox.1", KontrolNavn, True)
With mycmd

.MatchEntry = fmMatchEntryComplete
End With


"Claus" wrote:

Hi,

I hope one of you Gurus can help me on this one.

How can i set MatchEntry for this combobox ?

KontrolNavn = "Kontrol" & X + 1
Set mycmd = UserForm2.Controls.Add("Forms.combobox.1",
KontrolNavn,
True)
With mycmd
.Left = 170
.Top = 5 + X * 20
.Width = 100
.RowSource = Cells(Target.Row + X + 1, 4).Value
.Value = Cells(Target.Row + X + 1, Target.Column).Value
End With


Regards

Claus






Claus[_3_]

MatchEntry for combobox added during runtime
 
Hi again

Now i'm using

With mycmd
.MatchEntry = fmMatchEntryComplete
.MatchRequired = True
...
...
End With

but the MatchRequired dos'ent work with my combos added during runtime.
I've triede with a combobox added manually and it works.

Claus


"Patrick Molloy" skrev i en
meddelelse ...
in teh code below, I removed your lines to make the additions a bit
clearer...I hope!

Dim mycmd As ComboBox

Set mycmd = _
UserForm2.Controls.Add("Forms.combobox.1", KontrolNavn, True)
With mycmd

.MatchEntry = fmMatchEntryComplete
End With


"Claus" wrote:

Hi,

I hope one of you Gurus can help me on this one.

How can i set MatchEntry for this combobox ?

KontrolNavn = "Kontrol" & X + 1
Set mycmd = UserForm2.Controls.Add("Forms.combobox.1",
KontrolNavn,
True)
With mycmd
.Left = 170
.Top = 5 + X * 20
.Width = 100
.RowSource = Cells(Target.Row + X + 1, 4).Value
.Value = Cells(Target.Row + X + 1, Target.Column).Value
End With


Regards

Claus






Harald Staff

MatchEntry for combobox added during runtime
 
..Style = 2

HTH. Best wishes Harald

"Claus" skrev i melding
...
Sorry Patrick

It works.

I'm using the wrong property, i need to make sure that the user only can
select a listitem and type something else.




Claus[_3_]

MatchEntry for combobox added during runtime
 
Thank you Harald

Regards,
Claus


"Harald Staff" skrev i en meddelelse
...
.Style = 2

HTH. Best wishes Harald

"Claus" skrev i melding
...
Sorry Patrick

It works.

I'm using the wrong property, i need to make sure that the user only can
select a listitem and type something else.







All times are GMT +1. The time now is 09:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com