Ask Your Question

salsacook's profile - activity

2015-11-06 07:35:03 +0200 received badge  Famous Question (source)
2013-10-07 18:47:12 +0200 received badge  Famous Question (source)
2013-10-07 18:47:12 +0200 received badge  Popular Question (source)
2013-10-07 18:47:12 +0200 received badge  Notable Question (source)
2013-10-07 18:46:20 +0200 received badge  Popular Question (source)
2013-10-07 18:46:20 +0200 received badge  Notable Question (source)
2013-08-12 21:09:17 +0200 answered a question Incrementing within strings for user defined function
COUNTEXCUSEDFIELDS("B"&ROW()&":U"&ROW())

did the trick for me

2013-08-12 20:52:09 +0200 received badge  Scholar (source)
2013-08-12 20:50:55 +0200 asked a question Incrementing within strings for user defined function

I have a user defined function called

countExcusedFields("B4:U4")

It is used to count all field with a certain background color.

Function countExcusedFields(oSheetName, oRange)
Dim oCellRange As Variant
Dim oSheet As Variant
oSheet = ThisComponent.getCurrentController().getActiveSheet()
oCellRange = oSheet.getCellRangeByName(oRange)

It work's pretty well, but as I give a string as argument value i have to problem that is wont auto increment B5:U5, B6U6 and so on. Is there any way to get LO to autoincrement a value within this string so I don't need to edit 300 rows by hand ?

2013-08-12 08:43:13 +0200 asked a question custom function not automatic updating

I try to create a custom function for checking cell background color.

Function ColorCheck()
Dim v
oActiveSheet = ThisComponent.getCurrentController().getActiveSheet()
v=oActiveSheet.getCellByPosition( 0, 0)
if vartype(v) = 9 then
  ColorCheck = v.CellBackColor
else
if v.CellBackColor = 2302940 then
  ColorCheck = "TRUE"
endif
End Function

It basically works when I use "=ColorCheck()", but if I update the background of the referenced cell the value does not change until I recreate my function entry. I tried recalculating function but I does not work too.

How can I get this to auto update the value if I change the Color ?