ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create combo box dynamically (https://www.excelbanter.com/excel-programming/303440-create-combo-box-dynamically.html)

Duraiswamy Lingappan

Create combo box dynamically
 
Hi,

How to create comboboxes dynamically using in excel VBA.

This i need to create whenever I am creating the row..

Thanks
Durai



Bob Phillips[_6_]

Create combo box dynamically
 
'-----------------------------------------------------------------
Sub CreateCombobox()
'-----------------------------------------------------------------
Dim oWs As Worksheet
Dim oOLE As OLEObject

Set oWs = ActiveSheet

Set oOLE = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo box.1", _
Left:=200, Top:=100, Width:=80, Height:=32)


oOLE.ListFillRange = "A1:A10"

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in message
...
Hi,

How to create comboboxes dynamically using in excel VBA.

This i need to create whenever I am creating the row..

Thanks
Durai





Duraiswamy Lingappan

Create combo box dynamically
 
Thanks,

I am able to create combobox using this code.. Now I am able to move the
combo to other place.

But I need to create inside the cell where the user cannot able to move or
delete. When I click the cell it should show the drop down button in left
side by clicking that I should be able to show values as drop down list...

Regards
Durai

"Bob Phillips" wrote in message
...
'-----------------------------------------------------------------
Sub CreateCombobox()
'-----------------------------------------------------------------
Dim oWs As Worksheet
Dim oOLE As OLEObject

Set oWs = ActiveSheet

Set oOLE = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo box.1", _
Left:=200, Top:=100, Width:=80, Height:=32)


oOLE.ListFillRange = "A1:A10"

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in message
...
Hi,

How to create comboboxes dynamically using in excel VBA.

This i need to create whenever I am creating the row..

Thanks
Durai







Bob Phillips[_6_]

Create combo box dynamically
 
Is this more that you want

Sub AddDVDropDown()
With Actfivecell.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=
_
xlBetween, Formula1:="=A1:A10"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in message
...
Thanks,

I am able to create combobox using this code.. Now I am able to move the
combo to other place.

But I need to create inside the cell where the user cannot able to move or
delete. When I click the cell it should show the drop down button in left
side by clicking that I should be able to show values as drop down list...

Regards
Durai

"Bob Phillips" wrote in message
...
'-----------------------------------------------------------------
Sub CreateCombobox()
'-----------------------------------------------------------------
Dim oWs As Worksheet
Dim oOLE As OLEObject

Set oWs = ActiveSheet

Set oOLE = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo box.1",

_
Left:=200, Top:=100, Width:=80, Height:=32)


oOLE.ListFillRange = "A1:A10"

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in

message
...
Hi,

How to create comboboxes dynamically using in excel VBA.

This i need to create whenever I am creating the row..

Thanks
Durai









Tom Ogilvy

Create combo box dynamically
 
Actfivecell should probably be ActiveCell

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
Is this more that you want

Sub AddDVDropDown()
With Actfivecell.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,

Operator:=
_
xlBetween, Formula1:="=A1:A10"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in message
...
Thanks,

I am able to create combobox using this code.. Now I am able to move the
combo to other place.

But I need to create inside the cell where the user cannot able to move

or
delete. When I click the cell it should show the drop down button in

left
side by clicking that I should be able to show values as drop down

list...

Regards
Durai

"Bob Phillips" wrote in message
...
'-----------------------------------------------------------------
Sub CreateCombobox()
'-----------------------------------------------------------------
Dim oWs As Worksheet
Dim oOLE As OLEObject

Set oWs = ActiveSheet

Set oOLE =

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo box.1",
_
Left:=200, Top:=100, Width:=80, Height:=32)


oOLE.ListFillRange = "A1:A10"

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in

message
...
Hi,

How to create comboboxes dynamically using in excel VBA.

This i need to create whenever I am creating the row..

Thanks
Durai











Bob Phillips[_6_]

Create combo box dynamically
 
Unless I want five of them<g

Teach me to change Selection without trying it!

Bob

"Tom Ogilvy" wrote in message
...
Actfivecell should probably be ActiveCell

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
Is this more that you want

Sub AddDVDropDown()
With Actfivecell.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,

Operator:=
_
xlBetween, Formula1:="=A1:A10"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in

message
...
Thanks,

I am able to create combobox using this code.. Now I am able to move

the
combo to other place.

But I need to create inside the cell where the user cannot able to

move
or
delete. When I click the cell it should show the drop down button in

left
side by clicking that I should be able to show values as drop down

list...

Regards
Durai

"Bob Phillips" wrote in message
...
'-----------------------------------------------------------------
Sub CreateCombobox()
'-----------------------------------------------------------------
Dim oWs As Worksheet
Dim oOLE As OLEObject

Set oWs = ActiveSheet

Set oOLE =

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo box.1",
_
Left:=200, Top:=100, Width:=80, Height:=32)


oOLE.ListFillRange = "A1:A10"

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in

message
...
Hi,

How to create comboboxes dynamically using in excel VBA.

This i need to create whenever I am creating the row..

Thanks
Durai













Duraiswamy Lingappan

Create combo box dynamically
 
Thanks Mr.Bob Phillips

This is the one I want..

Regards
Duraiswamy

"Bob Phillips" wrote in message
...
Is this more that you want

Sub AddDVDropDown()
With Actfivecell.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,

Operator:=
_
xlBetween, Formula1:="=A1:A10"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in message
...
Thanks,

I am able to create combobox using this code.. Now I am able to move the
combo to other place.

But I need to create inside the cell where the user cannot able to move

or
delete. When I click the cell it should show the drop down button in

left
side by clicking that I should be able to show values as drop down

list...

Regards
Durai

"Bob Phillips" wrote in message
...
'-----------------------------------------------------------------
Sub CreateCombobox()
'-----------------------------------------------------------------
Dim oWs As Worksheet
Dim oOLE As OLEObject

Set oWs = ActiveSheet

Set oOLE =

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo box.1",
_
Left:=200, Top:=100, Width:=80, Height:=32)


oOLE.ListFillRange = "A1:A10"

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in

message
...
Hi,

How to create comboboxes dynamically using in excel VBA.

This i need to create whenever I am creating the row..

Thanks
Durai











Duraiswamy Lingappan

Create combo box dynamically
 
Hi,

I am able to create the dropdown now.. I have created this by giving input
of comma seperated string values..

I have one more requirement.
Whenever the user click on one cell that cell(sya C1) that value should be
selected in the dropdown(dropdown in A1). The dropdown value also containing
the value of C1..

Is this possible?

Regards
Durai

"Bob Phillips" wrote in message
...
Is this more that you want

Sub AddDVDropDown()
With Actfivecell.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,

Operator:=
_
xlBetween, Formula1:="=A1:A10"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in message
...
Thanks,

I am able to create combobox using this code.. Now I am able to move the
combo to other place.

But I need to create inside the cell where the user cannot able to move

or
delete. When I click the cell it should show the drop down button in

left
side by clicking that I should be able to show values as drop down

list...

Regards
Durai

"Bob Phillips" wrote in message
...
'-----------------------------------------------------------------
Sub CreateCombobox()
'-----------------------------------------------------------------
Dim oWs As Worksheet
Dim oOLE As OLEObject

Set oWs = ActiveSheet

Set oOLE =

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo box.1",
_
Left:=200, Top:=100, Width:=80, Height:=32)


oOLE.ListFillRange = "A1:A10"

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in

message
...
Hi,

How to create comboboxes dynamically using in excel VBA.

This i need to create whenever I am creating the row..

Thanks
Durai











Duraiswamy Lingappan

Create combo box dynamically - one more doubt
 
Hi,

I am able to create the dropdown now.. I have created this by giving input
of comma seperated string values..

I have one more requirement.
Whenever the user click on one cell that cell(sya C1) that value should be
selected in the dropdown(dropdown in A1). The dropdown value also containing
the value of C1..

Is this possible?

Regards
Durai



Tom Ogilvy

Create combo box dynamically
 
The dropdown will reflect the value of the Cell (A1) where it is contained.
So you would set the value of A1 to equal the value of the cell clicked by
the user.

--
Regards,
Tom Ogilvy

"Duraiswamy Lingappan" wrote in message
...
Hi,

I am able to create the dropdown now.. I have created this by giving input
of comma seperated string values..

I have one more requirement.
Whenever the user click on one cell that cell(sya C1) that value should be
selected in the dropdown(dropdown in A1). The dropdown value also

containing
the value of C1..

Is this possible?

Regards
Durai

"Bob Phillips" wrote in message
...
Is this more that you want

Sub AddDVDropDown()
With Actfivecell.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,

Operator:=
_
xlBetween, Formula1:="=A1:A10"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in

message
...
Thanks,

I am able to create combobox using this code.. Now I am able to move

the
combo to other place.

But I need to create inside the cell where the user cannot able to

move
or
delete. When I click the cell it should show the drop down button in

left
side by clicking that I should be able to show values as drop down

list...

Regards
Durai

"Bob Phillips" wrote in message
...
'-----------------------------------------------------------------
Sub CreateCombobox()
'-----------------------------------------------------------------
Dim oWs As Worksheet
Dim oOLE As OLEObject

Set oWs = ActiveSheet

Set oOLE =

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo box.1",
_
Left:=200, Top:=100, Width:=80, Height:=32)


oOLE.ListFillRange = "A1:A10"

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Duraiswamy Lingappan" wrote in

message
...
Hi,

How to create comboboxes dynamically using in excel VBA.

This i need to create whenever I am creating the row..

Thanks
Durai














All times are GMT +1. The time now is 07:27 PM.

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