Hi dave
thanks
I have change the way i want it a little bit
I have now
i combo box there show det dates there are in collumn a ( i have sort the
dates brfore this) Its made so the dates only comes one time in the combobox
even the date are there maybe 20 times imn the collumn , the i get an range
where all this dates are in Maybe from A1 to A20, from this range i get the
numbers in a second combobox -- all this working fine.
But when i selct a number in my second combobox i want to see where the
value are in in collunm, so i can get the value from C collumn
Try to see here all code:
Private Sub combo_sedatoer_Click()
Dim hvora As String
Dim ch As String
Dim s As String
Dim s1 As String
combo_timer.Clear
txtvaerdi.Text = ""
MsgBox combo_sedatoer.Value
hvorb = Me.combo_sedatoer.List(Me.combo_sedatoer.ListIndex, 1)
s1 = Replace(hvorb, "A", "B")
Dim rng3 As Range
Sheets("Ark1").Select
Set rng3 = Range(Range("Ark1!" & s1), Range("ark1!" & s1))
Me.combo_timer.List = rng3.Value
End Sub
Private Sub combo_sedatoer_DropButtonClick()
Dim i As Long
Dim iStart As Long
Dim iEnd As Long
Dim dtePrev As Date
Dim iArray As Long
Dim ary
dtePrev = 0: iArray = 1
ReDim ary(1 To 2, 1 To 1)
With Worksheets("Ark1")
Me.combo_sedatoer.Clear
For i = 1 To .Cells(Rows.Count, "A").End(xlUp).Row
If .Cells(i, "A").Value <> dtePrev Then
If i <> 1 Then
ReDim Preserve ary(1 To 2, 1 To iArray)
ary(1, iArray) = dtePrev
ary(2, iArray) = Range("A" & iStart & ":A" & iEnd).Address
iArray = iArray + 1
End If
iStart = i
iEnd = i
dtePrev = .Cells(i, "A").Value
Else
iEnd = i
End If
Next i
ReDim Preserve ary(1 To 2, 1 To iArray)
ary(1, iArray) = dtePrev
ary(2, iArray) = Range("A" & iStart & ":A" & iEnd).Address
Me.combo_sedatoer.List = Application.Transpose(ary)
End With
End Sub
So it it the address from
Me.combo_timer
I want
Can't use listindex
Reagrds
Alvin