I have a column of dates. It would be nice if I could somehow get the cell that contains the current date or a date in the past week, to be in bold. I wonder if that’s possible? I mean in a formula. So that the spreadsheet does it, changing by itself as time goes by.
I've got this in a macro that works: cbCell.FormulaLocal = "=" & srcAddr & "+STYLE(IF(CURRENT()<" & avg20dayAddr & "; ""Red""; ""Grn"" ))" So aCell.Formula = "=" & TODAY() & "+STYLE(IF(CURRENT() > " & Today() - 7 & "; ""boldDate""; ""notBold"" ))" boldDate & notBold are styles you'll have to define and the double quotes are necessary. If it's a single column it might be easier to write a macro that goes down the column comparing the dates to today() and setting the boldness appropriately. In which case: oCell.charWeight = com.sun.star.awt.FontWeight.BOLD or NORMAL is easier. Best of luck, Mike
Thanks for the, Mike. A bit over my head right now. Getting into macros is my next project. Haven’t they got incredibly more difficult since the days of Lotus 123, I think it was, when if I remember right (or I’m kidding myself, as I do so often) I used to make spreadsheets do anything I liked with macros that were a breeze to write…?
Select your dates. Click Format > Conditional > Date for Condition 1 Date is Today, apply style Accent. Cheers, Al
Thanks very much. Very nearly it. It gets the current date but how about the ‘date in the past week’? i.e. highlighting dates in the current week? Is that possible at all?
Instead of selecting Today, select the entry that says Last 7 days