|
-
Feb 4th, 2011, 10:50 AM
#1
Thread Starter
Addicted Member
[RESOLVED] creating dropdown list in excel cell in vb.net
I am creating an excel file and have to add a dropdown list to a cell. It looks like I need data validation, but my attempt errored on the .Add line.
Any ideas??
With wkbSheet.Range("H" & rowCt).Validation
.Delete()
.Add(Type:=Excel.XlDVType.xlValidateWholeNumber, _
AlertStyle:=Excel.XlDVAlertStyle.xlValidAlertInformation, Formula1:=lstString)
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
THanks
-
Feb 4th, 2011, 11:14 AM
#2
Thread Starter
Addicted Member
Re: creating dropdown list in excel cell in vb.net
Ok, found it myself,
With wkbSheet.Range("H" & rowCt).Validation
.Add(Type:=Excel.XlDVType.xlValidateList, AlertStyle:=Excel.XlDVAlertStyle.xlValidAlertStop, Operator:=Excel.XlFormatConditionOperator.xlBetween, Formula1:="=$M$1:$M$3")
End With
enjoy!
-
Nov 24th, 2011, 05:40 AM
#3
New Member
Re: [RESOLVED] creating dropdown list in excel cell in vb.net
Hi,
U added the content to ur dropdown from the same excel sheet.
Can we able to add the data to drop down in excel from VB combo box using VB.NET?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|