RobbieC
Active Member
- Joined
- Dec 14, 2016
- Messages
- 376
- Office Version
- 2010
- Platform
- Windows
Hi there, I have a UserForm with a ListBox which I am populating from a Range using:
Which grabs everything from Sheet "FilesInProject" in column B and throws it into the ListBox in the Userform. Brilliant!
However, in column A on the same sheet I have the type of file, ie PDF, JPG, GIF etc...
What I would like to do is to be able to reload the ListBox data, but with a filter, ie. a button on the userform: 'JPG' which will load in the List from column B, but only if column A has JPG in it....
I also have, in column C, the date when the file was created 11/04/2019 (in that format)... Ultimately, I would like to create a second 'date filter' where it would search for JPG in col A and within the date range in column C... I can get a calendar to select the date ranges ('from' and 'to' in 2 seperate TextBoxes), but that's as far as I have got
If anyone can help point me in the right direction, I'd be very grateful
Thanks
Rob
Code:
Private Sub UserForm_Initialize()
ListBox1.RowSource = Range(Sheets("FilesInProject").Range("B2"), Sheets("FilesInProject").Range("B65536").End(xlUp)).Address(, , , True)
End sub
Which grabs everything from Sheet "FilesInProject" in column B and throws it into the ListBox in the Userform. Brilliant!
However, in column A on the same sheet I have the type of file, ie PDF, JPG, GIF etc...
What I would like to do is to be able to reload the ListBox data, but with a filter, ie. a button on the userform: 'JPG' which will load in the List from column B, but only if column A has JPG in it....
I also have, in column C, the date when the file was created 11/04/2019 (in that format)... Ultimately, I would like to create a second 'date filter' where it would search for JPG in col A and within the date range in column C... I can get a calendar to select the date ranges ('from' and 'to' in 2 seperate TextBoxes), but that's as far as I have got
If anyone can help point me in the right direction, I'd be very grateful
Thanks
Rob