ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to create a new tab based on an existing tab (https://www.excelbanter.com/excel-programming/422092-macro-create-new-tab-based-existing-tab.html)

Maypop

Macro to create a new tab based on an existing tab
 
I have a spreadsheet that is effectively a payroll document it has a main
table with a line for each employee and a tab for each employee which are the
payslips and the information feeds from the main table into the tabs, I need
to create a macro that will add a new tab (for a new employee) based on the
last tab (scructure and functions) but move all the ref functions down one
row in the main table, meaning it will pull the details of the latest person
added to the spreadsheet. If anyone can provide any insight it would be
greatfully recieved.

joel

Macro to create a new tab based on an existing tab
 
the first thing I would do is have a blank templet sheet that I would copy
for each new employee. When adding new rows in the summary sheet I would
copy the last employee and insert a new line above the last employee. Thsi
is done so if there arre any total rows at the bottom the formulas for the
totals will be automatically changed when the row is added. I would then
highlight the entire row for the new employee and use REPLACE to change the
sheet name from the old employee to the new employee.

I described the actions as if you would manually do the operations put the
same thing can be done in a macro.

"Maypop" wrote:

I have a spreadsheet that is effectively a payroll document it has a main
table with a line for each employee and a tab for each employee which are the
payslips and the information feeds from the main table into the tabs, I need
to create a macro that will add a new tab (for a new employee) based on the
last tab (scructure and functions) but move all the ref functions down one
row in the main table, meaning it will pull the details of the latest person
added to the spreadsheet. If anyone can provide any insight it would be
greatfully recieved.



All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com