Dear All, I am trying to write a macro in order to create some sheets once it is invoked (e.g. through a button).
Sheet 1 contains a list. So cells in the first column contains a name: A1 = player1 A2 = player2 A3 = player3 A4 = player4 A5 = player5 A6 = player6 .. An = playern where n may change. So I need a funcition that counts the elements in column A (numberOfPlayer) and that create n sheets each called player1, player2, .., playern. I wrote something like this: Sub DateSheets() numberOhSheets=1 While Sheet1.A & numberOhSheets <> "" numberOhSheets = numberOhSheets + 1 Next For sht = 14 To 14 + numberOfSheets Sheets.Add after:=Sheets(Sheets.Count) Sheets(Sheets.Count).Name = Rosa.A & sht-13 Next End Sub What should I do to make it working? And how can I create a button to run it? Thanks a lot, Samuele -- For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted