Is it possible create a option button (or a variable…maybe) to active or inactive a group of programming lines on macro?
The following line codes have to be activated in a specific spreadsheet, but they have to be inactivated (or be hidden) in a normal spreadsheet.
'----------------------------------ON-LINE MAP ----------------------------------------------------------------------------------
lquantMandado = oCell.StartRow + 1
lmandado10 = lquantMandado mod 10
if lmandado10 = 0 then ' highlight in yellow 1 line in each 10 lines
oSheet.getCellByPosition(oCell.StartColumn + 1, oCell.StartRow).Value = 1
oRange1 = oSheet.getCellRangeByName("C"& oCell.StartRow + 1 & ":E" & oCell.StartRow + 1)
oRange2 = oSheet.getCellRangeByName("G"& oCell.StartRow + 1 & ":H" & oCell.StartRow + 1)
oRange1.CellBackColor = rgb(0,255,255) ' HIGHLIGHT YELLOW
oRange2.CellBackColor = rgb(0,255,255) ' HIGHLIGHT YELLOW
Else
oSheet.getCellByPosition(oCell.StartColumn + 1, oCell.StartRow).Value = 0
End If
Else
oRng = oSheet.getCellRangeByName("C"& oCell.StartRow + 1 & ":H" & oCell.StartRow + 1)
oRng.IsCellBackgroundTransparent = True ' cor transparente
oSheet.getCellRangeByName("H"& oCell.StartRow + 1).String =""
End If
oActiveCell.VertJustify = com.sun.star.table.CellVertJustify.CENTER
oActiveCell.HoriJustify = com.sun.star.table.CellHoriJustify.CENTER
oSheet.getCellRangeByName("H"& oCell.StartRow + 1).VertJustify = com.sun.star.table.CellVertJustify.CENTER
oSheet.getCellRangeByName("H"& oCell.StartRow + 1).HoriJustify = com.sun.star.table.CellVertJustify.CENTER
oSelection = oSheet.getCellByPosition(1,oCell.StartRow + 1)
ThisComponent.getCurrentController.select(oSelection)
oSelection = ThisComponent.createInstance("com.sun.star.sheet.SheetCellRanges")
ThisComponent.CurrentController.Select(oSelection)
if oCell.StartRow = 38 then ' spreadsheet must have 38 rows
While iResposta = 4
iResposta = MSGBOX ("Last Line",MB_DEFBUTTON2+5+64)
Wend
End if
'----------------------------------END OF ON-LINE MAP ------------------------------------------------------------