[Solved] Macro to GOTO a Cell using Row:Column NUMBERS?
[Solved] Macro to GOTO a Cell using Row:Column NUMBERS?
Does anyone have an example Macro to GOTO a cell that I have just written a Number In. All the examples seem to use Row/Column ID's like A5, rather than the equivalent X,Y coordinates of the Cell (IE: 0,4)?
Last edited by alf50 on Tue Nov 27, 2012 4:33 am, edited 1 time in total.
OpenOffice 4.1.14 on Mac Catalina(10.15.7), RasPi4B (TwisterOS-8/2023update) & MS Wnds10
Re: Macro to GOTO a Cell using Row:Column NUMBERS?
There is a getCellByPosition() method. A macro would look like
I'm not sure that you need to Go To (that is, select) that cell. There is no need to select the cell for most macro purposes.
Code: Select all
oSheets = ThisComponent.Sheets
oSheet = oSheets.getByName("Sheet1")
oCell = oSheet.getCellByPosition(0,4)
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Macro to GOTO a Cell using Row:Column NUMBERS?
To have oCell become the active one add this line to FJCC's code.
Code: Select all
ThisComponent.CurrentController.Select(oCell)