kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
Hello, I want to find out if this code below here can be made to load the data into a listbox instead of pasting it to the sheet. My knowledge is limited with the how. Thanks in advance.
Code:
Sub FilterDates()
Dim rCrit As Range
Sheets("HOME").UsedRange.ClearContents
With Sheets(“DATA”).UsedRange
Set rCrit = .Offset(, .Columns.Count).Resize(2, 1)
rCrit.Cells(2).Formula = "=SEARCH(TEXT(C2,""dd""),F2)"
'.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=rCrit, Unique:=False
.AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=rCrit, copytorange:=Sheets("HOME").Range("B1"), Unique:=False
End With
rCrit.Cells(2, 1).ClearContents
End Sub