Results 1 to 10 of 10

Thread: [RESOLVED] Default Excel User form Using VBA : Help on Unique Values.

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2019
    Posts
    37

    Resolved [RESOLVED] Default Excel User form Using VBA : Help on Unique Values.

    Hi Friends,

    I am stuck with one thing in a User form . I have a dropdown where the data is taking from a sheet. I want only unique values in the droplist. I already have the code , but can someone please help me to edit this code which will give only unique values in the droplist.

    Note : Dropdown Button Name is cmbSelChartAttr and datas for this dropdown is taking from "Inconsistency Order" Sheet.

    [CODE]:


    Function formInitialize(ws As Worksheet)
    Set ws = ThisWorkbook.Worksheets("Inconsistency Order")
    If ws.Visible = True Then
    ws.Activate
    Else
    ws.Visible = xlSheetVisible
    ws.Activate
    End If
    Dim i, lc
    Dim j
    Dim tecAttrVal As String
    lc = ws.Cells(1, Columns.Count).End(xlToLeft).Column
    i = 0

    For i = i + 1 To lc
    tecAttrVal = Cells(1, i).Value
    Me.cmbSelChartAttr.AddItem tecAttrVal
    'Me.cmbAttrXAxis.AddItem tecAttrVal
    tecAttrVal = ""
    Me.Label3.Visible = False
    Me.lsbOrderSet4SelAttr.Visible = False
    Next i
    End Function



    Thanks in Advance
    Last edited by sachinns; Jun 24th, 2019 at 05:05 AM.

Tags for this Thread

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