Private Sub ComboBox2_Change()
ActiveSheet.Cells(1, 5).Value = ComboBox1.Value
ActiveSheet.Cells(2, 5).Value = ComboBox2.Value
Dim dari As Date
Dim i As Long, Interval As Long
With ActiveSheet
If .FilterMode Then AutoFilter = False
dari = Format(.Range("E1").Value, "dd/mm/yyyy")
Interval = (.Range("E2") - .Range("E1")) + 1
i = dari
.Range("B5").AutoFilter Field:=1, Criteria1:=">=" & i, Operator:=xlAnd, Criteria2:="<" & i + Interval
End With
End Sub
Private Sub UserForm_Initialize()
For JmlH = 6 To 50
NilaI = Range("b" & JmlH)
ComboBox1.AddItem NilaI
ComboBox2.AddItem NilaI
Next JmlH
End Sub
No comments:
Post a Comment