I have a spreadsheet with an entry sheet, and several data sheets.
I have a button on the entry sheet that runs a macro that moves all of the data from the entry sheet to the various data sheets where the data belongs.
At the end of the macro, it clears the entry sheet so it's ready for the next entry.
I'm looking for a way to have it set the focus on cell C3 at the end of the macro.
This what I have and it doesn't work:
Sheet = thisComponent.Sheets.getByName("EnterData1")
Cell = Sheet.getCellRangeByName("C3")
Cell.setFocus
I've scoured the forums and haven't found an answer to this yet....
Any help would be most appreciated.
[Solved] Calc Macro to setFocus to a particular cell
[Solved] Calc Macro to setFocus to a particular cell
Last edited by monkee09 on Tue Mar 10, 2015 5:32 pm, edited 1 time in total.
WindowsXP, OOo3.0.0
Re: Calc Macro to setFocus to a particular cell
I think you want
Code: Select all
Sheet = thisComponent.Sheets.getByName("EnterData1")
Cell = Sheet.getCellRangeByName("C3")
ThisComponent.CurrentController.select(Cell)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: Calc Macro to setFocus to a particular cell
Perfect! I knew it had to be something fairly simple.
WindowsXP, OOo3.0.0