Results 1 to 3 of 3

Thread: [RESOLVED] creating dropdown list in excel cell in vb.net

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2003
    Posts
    193

    Resolved [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

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Apr 2003
    Posts
    193

    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!

  3. #3
    New Member
    Join Date
    Nov 2011
    Posts
    1

    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
  •  



Click Here to Expand Forum to Full Width