OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Help needed with Calc sheet copying

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
combatwombat_nz
Newbie
Newbie


Joined: 31 Mar 2006
Posts: 1

PostPosted: Fri Mar 31, 2006 2:07 am    Post subject: Help needed with Calc sheet copying Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group