Sub main
oCtrl = ThisComponent.CurrentController
oCtrl.Select(oCtrl.ActiveSheet.GetCellRangeByName("B3:B9"))
ThisComponent.getCurrentSelection.ClearContents(23)
End Sub
Code credits : @einstein
i use push button to execute this function. My question is how will i select cell B1 after executing this code.
???????????????
Maybe I do not understand your question... Or maybe you have not too much knowledge about macro programming...
Einstein's example code contains the 'commands' how to select a cellrange (or a single cell) by macro.
Code: Select all
Sub main
oCtrl = ThisComponent.CurrentController
oCtrl.Select(oCtrl.ActiveSheet.GetCellRangeByName("B3:B9"))
ThisComponent.getCurrentSelection.ClearContents(23)
oCtrl.Select(oCtrl.ActiveSheet.GetCellRangeByName("B1"))
End Sub