Hallo Willem,

Zie de code hieronder. Je stopt nu het groene gedeelte in de macro als
subroutine. In je hoofdprogramma (rood) kan je dan de korte versie
aanroepen met de plaats als parameter.


sub testen
 verspringen "$A$1"
rem doe iets
         verspringen "$C$5"
end sub

sub verspringen( plaats as string)
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document

document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = plaats

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())


end sub

Het is niet zo eenvoudig als in VBA, dat ben ik wel met je eens.


Op 7 januari 2014 12:57 schreef Willem075 <[email protected]>:

> Dag Paul,
>
>     Bedankt voor de reactie. Misschien werkt Select(A1) wel in Excel-VBA
> maar het werkt niet in LibreOffice-Basic. Ook bijvoorbeeld Select(2,3)
> werkt niet.
>
>     Vriendelijke groet,
>
> Willem
>
>
>
>
> op 07-01-14 12:27, Paul Strucks schreef:
>
>  Willem, zorg dat de laatste regel van de macro staat: Select(A1).
>> Dat moet voldoende zijn.
>> Groet,
>> Paul
>>
>> Willem075 schreef op 7-1-2014 12:18:
>>
>>> Beste lezers,
>>>
>>> In een macro voor een LibreOffice-Calc rekenblad wil ik na een zoekactie
>>> dat de cursor op de cel A1 gaat staan. Is er iemand die daarvoor de
>>> macrocode kan geven?
>>>
>>>
>>> Vriendelijke groet,
>>>
>>> Willem
>>>
>>>
>>>
>>>
>>
>>
>
> --
> Unsubscribe instructions: E-mail to [email protected]
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/nl/users/
> All messages sent to this list will be publicly archived and cannot be
> deleted
>
>

-- 
Unsubscribe instructions: E-mail to [email protected]
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/nl/users/
All messages sent to this list will be publicly archived and cannot be deleted

Antwoord per e-mail aan