Results 1 to 3 of 3

Thread: How to use datavalidation in VBA

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Aug 2011
    Posts
    19
    Location

    Question SOLVED: How to use datavalidation in VBA

    Hi i am trying to create code but dont know how to implement it to see the data validation cells.

    [vba]Private Sub CommandButton1_Click()
    Dim cbo As OLEObject
    Dim ws As Worksheet
    Dim NextRow As Long

    Set ws = Worksheets("ConduitCollectedInfo")
    If ws.Range("A1").Value2 = "" Then

    ws.Range("A1:N1").Value = Array("Colour", "Size", "Product", "Quantity")
    NextRow = 2
    Else

    NextRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row + 1
    End If

    With Worksheets("Conduit")

    ws.Cells(NextRow, "A").Value =
    ws.Cells(NextRow, "B").Value =
    ws.Cells(NextRow, "C").Value =
    ws.Cells(NextRow, "D").Value = .OLEObjects("Textbox1").Object.Value
    End With
    End Sub[/vba]

    Thats my code i need the Rows A,B and C to match up with the 3 data validation lists i have.

    Ive uploaded incase i make no sense :P ...5.xlsm

    Thanks in advance for the help
    Last edited by lovett10; 08-19-2011 at 07:39 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •