Calc VBA Macro: Any way to conditionally format text color? [closed]

asked 2015-07-27 18:48:36 +0200

MrMusAddict gravatar image

updated 2015-08-24 06:05:40 +0200

Alex Kemp gravatar image

I am in charge of generating and maintaining excel documents at work, and I have created a few robust macros in which our company will use. I originally created the macros in excel, but we now have began a migration to Libreoffice.

The macros themselves are simple enough, so aside from the conditional formatting issue, they work flawlessly.

It seems in the version of LibreOffice I have (, I am able to create the condition, however I am not able to alter any attributes. For example:

With Range("C14:Q14, C19:Q19, C23:Q23, T14, T19, T23").FormatConditions _
    .Add(xlCellValue, xlLess, 0.95)
    '.Font.Color = RGB(190, 0, 0)
    ''.Font.Bold = True
End With

This code compiles, and runs, so I am assuming that I am successfully defining a condition , but as soon as I remove the singe quotes, I receive an error:

BASIC runtime error.

So, I'm assuming that FormatConditions is Excel specific? If so, is there a way to use styles in conjunction with a condition?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by JohnSUN
close date 2018-09-20 07:31:26.892549


any silly code compile and runif you 'comment out all the stuff

karolus gravatar imagekarolus ( 2015-07-27 20:02:17 +0200 )edit

why didnt you simply apply the Conditional -Format manually ?

karolus gravatar imagekarolus ( 2015-07-27 20:05:30 +0200 )edit

"any silly code compile and run if you comment out all the stuff" : I was trying to point out the fact that calc still runs Range().FormatConditions, but doesn't allow me to alter the font within the With code. -- "why didn't you simply apply the Conditional Format manually?" : I'm assuming you mean after the macro runs? Well, that defeats the purpose of the macro (at least this one).

MrMusAddict gravatar imageMrMusAddict ( 2015-07-27 20:19:15 +0200 )edit