Hi,
I have a table of payroll data that is obviously sensitive and portions of that table must be sent to different people each month. There are some pivot tables that summarize the data off the table. Each month, I have to save the file under a different file name, eliminate the data I don't want sent, refresh the pivot tables, password protect the workbook, then send it to each person. This is time-consuming. Was hoping someone could help me write the VBA to do this for me.

I have a start on this. I have a Base data table, a Staging data table and a Users table. The VBA in the macro (which I picked up from this site a while ago, I think) goes to the Users table, filters the base table for the first user in the list. Then it copies the filtered data to the staging table and updates the pivot that is baesd on the staging table data. Then it copies the staging table and pivot to a new (temp) work book and emails it to the email address for that user in the Users table. Then it goes back to the next record in the Users table and performs again.

The issues I have are:
1. I can't figure out how to password protect each temp file
2. The pivot in the file that the "receiver" gets still references the data in the master work book, not the data in the temp work book.

Can someone help me with this? I'm not a power VBA user. I can read what the VBA does but cannot really write it with any sense of efficiency.

Thanks!
Matt