View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default 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.