Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    copy line with 2 condition.... (2000 sr 1)

    Messaggio cancellato da sal21

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: copy line with 2 condition.... (2000 sr 1)

    Sal,

    You are asking far too much. You want us to create a complete application for you here. You have been told before that the purpose of the Lounge is to help people with specific questions, not to do their work for them.

    You should be able by now to use all the help you have been given in the Lounge and in many other discussion forums and newsgroups to create the userforms and to write the code. You have received similar code several times, so look through your old threads. You are welcome to post specific questions about details in the code.
    If you are not able to do this, you should hire a professional programmer to create the application for you.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy line with 2 condition.... (2000 sr 1)

    Hi Hans...
    I have mked a user form my self....
    But have only a prob:
    After the function have selected the value ( from column C withouth dupes) how to show into list this...

    example only:

    4500
    4501
    4503

    Private Function UniqueItemList(InputRange As Range, HorizontalList As Boolean) As Variant
    Dim cl As Range, cUnique As New Collection, i As Long, uList() As Variant
    Application.Volatile
    On Error Resume Next
    For Each cl In InputRange
    If cl.Formula <> "" Then
    cUnique.Add cl.Value, CStr(cl.Value)
    End If
    Next cl
    UniqueItemList = ""
    If cUnique.Count > 0 Then
    ReDim uList(1 To cUnique.Count)
    For i = 1 To cUnique.Count
    uList(i) = cUnique(i)
    Next i
    UniqueItemList = uList
    If Not HorizontalList Then
    UniqueItemList = Application.WorksheetFunction.Transpose(UniqueItem List)
    End If
    End If
    On Error GoTo 0
    End Function


    Private Sub UserForm_Initialize()
    Dim MyUniqueList As Variant, i As Long
    With Me.ComboBox1
    .Clear ' clear the listbox content
    MyUniqueList = UniqueItemList(Range("C2:C1000"), True) 'Here the range of your data is set
    For i = 1 To UBound(MyUniqueList)
    .AddItem MyUniqueList(i)
    Next i
    .ListIndex = 0 ' select the first item
    End With
    End Sub

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: copy line with 2 condition.... (2000 sr 1)

    Try replacing

    cUnique.Add cl.Value, CStr(cl.Value)

    with

    cUnique.Add Left(cl.Value, 4), Left(cl.Value, 4)

Posting Permissions

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