Hi there,
Having an issue getting vba code (wich works fine) into a UserForm.
The VBA code is running on the sheet included.
The used code is following ( Thx to some other forums where i found it)
I would like to create on "Blad2" a userform which has the same result.
Unfortunally i don't have a lot experience comes to VBA.
i already prepaired the form a bit but can't get some things working
Made a print screen also.
So in the dropdown make the same choices and get the results under it.
hope it make sense.
Don't know how to get the complete file uploaded and if this is allowed.
Hope someone can help me out.
Having an issue getting vba code (wich works fine) into a UserForm.
The VBA code is running on the sheet included.
The used code is following ( Thx to some other forums where i found it)
VBA Code:
Private Function hdrs(Par1 As String, Par2 As String) As String
Dim tbl6 As ListObject
Dim rit As String
Dim Lrow As Long
Set tbl6 = ActiveSheet.ListObjects("Tabel6")
Lrow = tbl6.Range.Rows.Count
For Each cl In ActiveSheet.Range("D2:J" & Lrow)
If cl.Value = Par2 And Cells(cl.Row, 2) = Par1 Then
If InStr(1, rit, Cells(1, cl.Column).Value) = 0 Then
rit = rit & Cells(1, cl.Column).Value & ", "
End If
End If
Next cl
If rit <> "" Then hdrs = Left(rit, Len(rit) - 2)
End Function
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B18:C18")) Is Nothing Then
If Range("B18") <> "" And Range("C18") <> "" Then
Range("D17") = hdrs(Range("B18"), Range("C18"))
End If
End If
End Sub
Code:
Unfortunally i don't have a lot experience comes to VBA.
i already prepaired the form a bit but can't get some things working
Made a print screen also.
So in the dropdown make the same choices and get the results under it.
hope it make sense.
Don't know how to get the complete file uploaded and if this is allowed.
Hope someone can help me out.
Fiteren ritten (1).xlsm | |||
---|---|---|---|
F | |||
24 | |||
Blad1 |