2012/10/20 Luuk <[email protected]>: > On 20-10-2012 17:14, Johnny Rosenberg wrote: >> >> Once again I did it: I sent my reply directly to the OP, not to the >> list. Sorry. *Sigh…* >> >> Here's what I wrote, in case someone is interested: >> > >> When i go to >> Tools/Macros/Organize Macros/LibreOffice Basic >> >> Than i see i macro called 'CallUsLeapYear' under: >> Libreoffice Macros/Tools/Misc >> >> First you need to move or copy it to, I think it's called ”MyMacros & >> Dialogs”. >> >> >> What is the use of the macros in the place i mentioned, >> if they cannot be used directly? >> </Message> >> >> I would guess that they are supposed to be called from other Basic >> subroutines. >> >> >> >> Kind regards >> >> Johnny Rosenberg >> ジョニー・ローゼンバーグ >> > > sorry for posting to the group, and not replying to you personally ;) > > > But indeed, if i create a new macro in 'MyMacros&Dialogs' like this: > function testleap(i) > dim x as boolean > If CalIsLeapYear(i) Then > testleap = "J" > Else > testleap = "N" > End if > end function > > i can type '=testleap(2012)' in a cell > and it will return 'J'
Well, that's nice! The first line of the function – dim x as boolean – seems to be a bit necessary since you don't use x anyway, though. By the way, 'J' and 'N' – is that for Ja and Nej (Swedish for Yes and No)…? Kind regards Johnny Rosenberg ジョニー・ローゼンバーグ -- For unsubscribe instructions e-mail to: [email protected] 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
