Hi there. New here.
So I’ve been searching this website on how to hide or show a button. And I came across this macro:
sub hidebutton
oSheet = ThisComponent.CurrentController.ActiveSheet
oButton = oSheet.DrawPage.Forms.getByIndex(0).getByName(“button1”)
oButton.EnableVisible = False 'Hide the buttonend sub
I tried it on my spreadsheet to hide a button and it works. But honestly my macro knowledge are all based on what I found on this website. I searched on the internet and I mostly got answers for Excel. So I need a macro that hides/shows a button based on a cell value, and another one that enables/disables it based on a cell value.
For example:
If A1=1, then button is visible
If A1=0, then button is not visible
and
If A1=3, then button is enabled
If A1=2, then button is disabled
I need these two functions separately for my use cases.
Thank you very much in advance!