VBA to create sheet based on unique value, no duplicate sheets

bdavis47

New Member
Joined
Jul 7, 2017
Messages
1
Hello all, I am trying to create a worksheet to track numerous financial accounts. I have a "Data" tab that receives input from another VBA ("GL" sheet) that adds new rows of data (no overwriting) and then refreshes pivots. The data it receives is "Pulse Account", "Comments", "Amount", "Date". Within the data tab I have columns that give "Month", "Year", "Debit", "Credit", and "GL Account"; all of these are formula based. In specific, "GL Account" uses vlookup to cross reference the "Pulse Account" to the corresponding GL Account on another tab. What I would like to do is as follows:

Create a VBA based button that does the following functions:
1. Identifies unique "GL Account" values from the "Data" tab.
2. Creates new worksheets named after the unique value from above.
3. Ensures there are no duplicate sheets.
4. Refreshes all Pivots on all sheets.

From there I would make a pivot table on each sheet using the "Data" tab as a dynamic range, filtering to just the "GL Account" the sheet is named after. It would contain a "Year" filter, with columns for "Month" and rows for SUM of "Debit", SUM of "Credit", and Totals. I don't think there is way to automate this pivot creation.

My goal is to have a workbook where the 4 original data elements can be entered, the data tab generate the rest of the information, and then the VBA code ensure there are worksheets for each "GL Account". Data added for GL Accounts that already have a sheet would simply update the pivot. I hope this make sense. I have been learning VBA and finally got my add data button to work :)
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,214,918
Messages
6,122,249
Members
449,075
Latest member
staticfluids

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