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+help@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
Context
- [libreoffice-users] Macro to create sheets · Samuele Zampini
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.