advanced filter by textbox into sheet and paste another sheet

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
995
Office Version
  1. 2010
hello
i have this code works well i try to adjust for filtering data by textbox instead of cells value and i would to filter data and paste to another sheet if i choose a new data copy and paste under old data in the other sheet but if i repeat filtering data are already existed in the other sheet then ignore them just copy and paste a new data
VBA Code:
Sub nn()
Dim StartDate As Date
Dim EndDate As Date
StartDate = Range("j2").Value
EndDate = Range("h2").Value
'StartDate = TextBox1.Value
'EndDate = TextBox2.Value
ActiveSheet.Range("A3:e3").AutoFilter field:=1, Criteria1:=">=" & CDbl(StartDate), Operator:=xlAnd, Criteria2:="<=" & CDbl(EndDate)
AutoFilterMode = False
End Sub

thanks advance
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Watch MrExcel Video

Forum statistics

Threads
1,129,664
Messages
5,637,643
Members
416,979
Latest member
CapeCon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top