This is my macro that is not working. I have a formula in D8 that detects the length of of another cell in the spreadsheet. It displays "1" if the cell length is zero and nothing if the cell length is greater than zero. If the formula in D8 produces a "1" I want to hide the D row. For some reason this is not working. Could someone with much greater knowledge please help me troubleshoot?Sub FTest()
theSheet=thisComponent.getSheets.getByName( "Production" )
CellDest = theSheet.getCellByPosition(4,8)
If CellDest.string = "1" then CellDest.Rows.IsVisible=false
end if
end sub
[Solved] Hide row based on cell value - Issues with macro?
[Solved] Hide row based on cell value - Issues with macro?
Last edited by Bdelude89 on Wed Mar 28, 2018 2:40 pm, edited 1 time in total.
Openoffice 3 on Windows 10
Re: Hide row based on cell value - issues with macro?
This line is returning cell E9
because rows and columns are indexed from 0: A = 0, B = 1, C = 2, D = 3. Similarly, and confusingly, row 1 has an index of 0.
Code: Select all
CellDest = theSheet.getCellByPosition(4,8)
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: Hide row based on cell value - issues with macro? [SOLVE
Thank you, good looking out!
Openoffice 3 on Windows 10