Вот макрос для вас:
REM ***** BASIC *****
Sub Main
End Sub
sub arg
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 = "$A$4"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "StringName"
args2(0).Value = "30"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args2())
dim args4(0) as new com.sun.star.beans.PropertyValue
for a=0 to 100
args1(0).Name="ToPoint"
args1(0).Value="a"+(a+4)
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "", 0, Array())
rem ----------------------------------------------------------------------
args4(0).Name = "StringName"
args4(0).Value = "="&30-(3*a)
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args4())
next a
rem ----------------------------------------------------------------------
end sub