Ask Your Question

Revision history [back]

I have done similar, only I have the button add a number to a cell, than use that cell to say something in another, with the IF and the CONCATENATE commands in a cell. The sub below I created by "Tools/Macros/record macro". then I called "Entered_1_in_a_cell_H_11" in the sub which was assign to the button. Good luck.

sub Entered_1_in_a_cell_H_11 rem define variables dim document as object dim dispatcher as object rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "ToPoint"

args1(0).Value = "$H$11"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1()) dim** args2(0) as new com.sun.star.beans.PropertyValue args2(0).Name = "StringName" args2(0).Value = "1" dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args2()) dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "", 0, Array()) end sub