VBA Code to Generate Report from All Sheets

Cristinky420

New Member
Joined
Feb 13, 2019
Messages
17
Hey there!

I am building a database and am trying to generate metrics from Log sheets in my workbook.

Below is the report I would like to generate.


Book1
ABC
2Report Generated:
3Report Start:
4Report End:
13
14Client Services +/-
15Clients Registered
16Clients Deceased
17
18Client Interaction Breakdown
19# of LogsTime
20Phone
21E-mail
22Clinic
23In-Home
24Follow-up
Metrics


I have a Button on this sheet that opens UserForm1. UserForm1 then shows two date pickers: Report Start Date (DTPicker1) and Report End Date (DTPicker2). Once dates are picked there is CommandButton1 which I would then input the code into.

I would like the code to return counts and sums that are between the Report Start & End Dates as follows:

  • B2 would equal the day the report is generated
  • B3 would be the value of DTPicker1
  • B4 would be the value of DTPicker2
  • B15 would be a count of Master!Q:Q if the dates fall within the reporting dates
  • B16 would be a count of Master!U:U if the dates fall within the reporting dates
  • B20 would count across all sheets if the date in A:A is within the reporting days and there is an "x" in B:B in that row
  • C20 would sum the value in G:G across all sheets if the date in A:A in that row is within the reporting days, and there is an "x" in B:B in that row
  • B21 would count across all sheets if the date in A:A is within the reporting days and there is an "x" in C:C in that row
  • C21 would sum the value in G:G across all sheets if the date in A:A in that row is within the reporting days, and there is an "x" in C:C in that row
  • B22 would count across all sheets if the date in A:A is within the reporting days and there is an "x" in D:D in that row
  • C22 would sum the value in G:G across all sheets if the date in A:A in that row is within the reporting days, and there is an "x" in D:D in that row
  • B23 would count across all sheets if the date in A:A is within the reporting days and there is an "x" in E:E in that row
  • C23 would sum the value in G:G across all sheets if the date in A:A in that row is within the reporting days, and there is an "x" in E:E in that row
  • B24 would count across all sheets if the date in A:A is within the reporting days and there is an "x" in F:F in that row
  • C24 would sum the value in G:G across all sheets if the date in A:A in that row is within the reporting days, and there is an "x" in F:F in that row


Example of Master Sheet:


Book1
AQU
1Client #Deceased DateRegistration Date
200021-Jan-2019
300041-Feb-2019
40005
50006
600091-Mar-2019
7001015-Jan-2019
Master


Example of Log Sheet:


Book1
ABCDEFGH
10002Adams, AdamActive
2DateVisit TypeTime (h:mm)File notes
3PhoneE-mailClinicIn-HomeFollow-up
4Totals:111115:00
51-Jan-2019x1:00
61-Feb-2019x1:00
71-Mar-2019x1:00
81-Apr-2019x1:00
91-May-2019x1:00
0002


Thank-you for your help!!!!!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,224,885
Messages
6,181,585
Members
453,055
Latest member
cope7895

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