Hi @gemarsh, follows a suggestion with macro.
test file|attachment
The macro is linked to Spreadsheet Events, Content changed.
Sub xhk ( oCelula )
' Testar se o objeto selecionado é uma célula individual
If oCelula.ImplementationName <> "ScCellObj" Then Exit Sub
If Right(oCelula.AbsoluteName,4) = "$A$1" Then
GoToCel "$A$1"
Dim oSel as Object
oSel = ThisComponent.getCurrentSelection()
Var1 = oSel.getString()
GoToCel "$A$2"
oSel = ThisComponent.getCurrentSelection()
Var2 = oSel.getString()
If Var1 > Var2 Then
GoToCel "$A$2"
EnterString Var1
End if
End If
End Sub
Sub EnterString ( xDig$ )
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "StringName" : args1(0).Value = xDig
CreateUnoService("com.sun.star.frame.DispatchHelper") _
.executeDispatch(ThisComponent.CurrentController _
.Frame, ".uno:EnterString", "", 0, args1())
End Sub
Sub GoToCel ( xLocal$ )
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint" : args1(0).Value = xLocal
CreateUnoService("com.sun.star.frame.DispatchHelper") _
.executeDispatch(ThisComponent.CurrentController.Frame _
, ".uno:GoToCell", "", 0, args1())
End Sub
ATTENTION: If you would like to give more details to your question, use edit in question or add a comment below. Thank you.
If the answer met your need, please click on the ball
to the left of the answer, to finish the question.