Dear VBA Gurus,
Thank you in advance for taking a look at this.
I have a large data table with column V containing dates, many of which are duplicate. At this time I have a Multiselect Listbox that shows the unique dates from column V. The goal is to have user select one or more of those dates, and the have the code delete all the rows that do not have a matching date in column V as compared to those selected in the Listbox; so essentially the user selects the dates that need to be kept.
My understanding is that I need to have a dynamic array with the selected Listbox1 values, and then delete all rows that do not have values matching that array. I have found many examples of similar code, but all of them center around finding Strings, not dates or numbers.
The two key questions for me are:
1) What is the proper code to populate such an array with the items (dates) selected in the Listbox?
2) What would be the best example of the loop to run through my column V of the table and delete the rows that don’t match dates in array (items selected in Listbox)?
I am very appreciative of any examples. Thank you.
Thank you in advance for taking a look at this.
I have a large data table with column V containing dates, many of which are duplicate. At this time I have a Multiselect Listbox that shows the unique dates from column V. The goal is to have user select one or more of those dates, and the have the code delete all the rows that do not have a matching date in column V as compared to those selected in the Listbox; so essentially the user selects the dates that need to be kept.
My understanding is that I need to have a dynamic array with the selected Listbox1 values, and then delete all rows that do not have values matching that array. I have found many examples of similar code, but all of them center around finding Strings, not dates or numbers.
The two key questions for me are:
1) What is the proper code to populate such an array with the items (dates) selected in the Listbox?
2) What would be the best example of the loop to run through my column V of the table and delete the rows that don’t match dates in array (items selected in Listbox)?
I am very appreciative of any examples. Thank you.