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
|