combatwombat_nz Newbie

Joined: 31 Mar 2006 Posts: 1
|
Posted: Fri Mar 31, 2006 2:07 am Post subject: Help needed with Calc sheet copying |
|
|
Hi, am trying to use a Macro for copying a Calc sheet inside the same "Workbook".
I have a bunch of sheets, one of which is a Template with specific calculations, etc, that apply to Staff members. I want to copy this template to another workable spreadsheet. This is how I accomplish that using code:
Create a new macro like such:
sub new_sheet
oDocument = ThisComponent
oSheets = oDocument.Sheets
numSheets = (oSheets.Count)
SheetName = "NewStaff" + (numSheets -4)
oSheets.copyByName("TEMPLATE",SheetName,numSheets)
end sub
Then using the Form controls, create a new button, and assign the macro to it. The button should be on the Template. Then the same button is transferred automatically to each new sheet created. |
|