Hi Excel Ninjas!
I am having an issue where I can't seem to figure out how to fill a listbox with rows that only 2 months old based/compare the data value to a Now() function in row "R". I also would like to multiselect the values and click delete to remove them from the sheet ("Test").
I have headers on A1 to M, data starts on row 2. Also my Listsource is a dynamic list name"ItemList". I am tinkering this code, but no success.
Results: nothing. Selected items are not deleting from sheet "Test".![]()
Sub DeleteData() Dim i as integer Dim rng as Range last = Cells(Rows.Count, "A").End(xlUp).Row Set rng = Range("A1:A" & last) For i = last To 1 Step -1 If rng(i).Value = Listbox1.value Then rows(i).Entirerow.Delete End If Next End Sub
Thank you!
Bookmarks