VBA UserForm: Filter data in between dates using sheet name (FYI: i have multiple sheets, around 20-30 of them)

wcanarejo

New Member
Joined
Jun 5, 2021
Messages
9
Hi everyone,

I am new to Excel VBA, and I have some issues filtering data in between dates.
I Just want to be able to filter entries (from date-to date) using the sheetname as a criteria.

This is how the form look like( please see attached photo)


Or if you have any way get this sorted out, please do suggest. I really need your help.
Thank you very much
 

Attachments

  • sheet viewing.PNG
    sheet viewing.PNG
    38.6 KB · Views: 6

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try inserting this line of code:
VBA Code:
.Parent.PrintOut
immediately below this line:
VBA Code:
.Range("A1").CurrentRegion.AutoFilter Field:=1, Criteria1:=">=" & CLng(beginDate), Operator:=xlAnd, Criteria2:="<=" & CLng(endDate)
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,821
Members
449,049
Latest member
cybersurfer5000

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
Back
Top