Hi,
I have a Summary sheet from which I need to extract the data based on date criteria and paste values in Search Sheet.
Hi,
I have a Summary sheet from which I need to extract the data based on date criteria and paste values in Search Sheet.
According to your attachment a starter Excel basics VBA demonstration to paste only to Sheet3 (Search) worksheet module :
PHP Code:
Sub Demo1()
[Y1:Z2] = Evaluate("{""Date"",""Date"";"">=" & [B1].Value2 & """,""<=" & [B2].Value2 & """}")
Sheet2.UsedRange.Offset(7 - Sheet2.UsedRange.Row).AdvancedFilter 2, [Y1:Z2], [A4:J4]
End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon « ★ Add Reputation » ! ◄ ◄
Thanks, but I am getting the error "The extract range has a missing or invalid field name" in the below line
Please Login or Register to view this content.
Have you changed column headings as macro is looking for heading of "Date"; works fine on your posted file.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
As I wrote : « according to your attachment »
Barieq,
try
Please Login or Register to view this content.
@Marc L,
I have tried running your code according to my attachment, but gives me the same error. Anyway thanks the thread is solved by Jindon
@Jindon,
Thanks, your code works perfectly. Solved..
Something weird on your side as it works on ours
According to your attachment a simplified variation still only into Sheet3 (Search) worksheet module :
PHP Code:
Sub Demo2()
With Sheet2
.[B2].Formula = "=(B8>=" & [B1].Value2 & ")*(B8<=" & [B2].Value2 & ")"
.Range("A7", .Cells(.Rows.Count, 2).End(xlUp)(1, 9)).AdvancedFilter 2, .[B1:B2], [A4:J4]
End With
End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon « ★ Add Reputation » ! ◄ ◄
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks