asyamonique
Well-known Member
- Joined
- Jan 29, 2008
- Messages
- 1,220
- Office Version
-
- 2013
- Platform
-
- Windows
Hello,
Good Day,
I have huge datas from column A to F all the way down..
The code given below populates the related date values by a combobox.
My question is to populate related datas base on the current date to one week ahead by a command button.
What I want when I click on command button only weekly datas will appear!
ıf today is 1st of nov. listbox will show the datas from 1st to 8th entries..
Many Thanks
Good Day,
I have huge datas from column A to F all the way down..
The code given below populates the related date values by a combobox.
Code:
Private Sub ComboBox6_Change()Application.ScreenUpdating = False
Dim a, i As Long, ii As Long, b(), n As Long
ListBox1.Clear
With ComboBox6
If .Text = "" Then Exit Sub
If WorksheetFunction.CountIf(Worksheets("list").Range("a:a"), .Text) = 0 Then
TextBox6 = ("")
Exit Sub
End If
a = Worksheets("list").Range("a1").Resize(Worksheets("list").Range("a" & Rows.Count).End(xlUp).Row, 6).Value
For i = 1 To UBound(a, 1)
If a(i, 1) = .Text Then
n = n + 1: ReDim Preserve b(1 To 6, 1 To n)
For ii = 1 To UBound(a, 2)
b(ii, n) = a(i, ii)
Next
b(1, n) = Format$(a(i, 1), "dd-mmmm-yyyy")
b(2, n) = Format$(a(i, 2), "dd-mmmm-yyyy")
End If
Next
End With
With ListBox1
.ColumnCount = 6
.ColumnWidths = "120;120;170;80;60;60"
.Column = b
End With
With Application
Me.TextBox6.Value = .Count(.Index(b, 4, 0)) & (" Rez.")
End With
End Sub
My question is to populate related datas base on the current date to one week ahead by a command button.
What I want when I click on command button only weekly datas will appear!
ıf today is 1st of nov. listbox will show the datas from 1st to 8th entries..
Many Thanks
Last edited: