REM ***** BASIC ***** Sub selectSheetByIndex(doc, index) doc.getCurrentController.select(doc.getSheets().getByIndex(index)) End Sub sub Macro1 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 args2(0) as new com.sun.star.beans.PropertyValue args2(0).Name = "ToPoint" args2(0).Value = "$A$1" dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2()) rem ---------------------------------------------------------------------- dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "StringName" args1(0).Value = "2222" dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args1()) selectSheetByIndex(ThisComponent, 1) Macro2 end sub sub Macro2 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 args2(0) as new com.sun.star.beans.PropertyValue args2(0).Name = "ToPoint" args2(0).Value = "$A$1" dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2()) rem ---------------------------------------------------------------------- dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "StringName" args1(0).Value = "1111" dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args1()) end sub