Thanks a lot. I think I get it now, but definately tricky.
Can I be cheeky and ask one more question relating to similar syntax?
I have 1 other formula:
MyFormula = "= 31-(SUM((COUNTIF($C5:$AG5,{""H"",""S"",""M"",""L"",""W""})))+(COUNTIF(C5:AG5,""AM"")/2)+(COUNTIF(C5:AG5,""PM"")/2))"
Instead of using a fixed value 30 which could also 29 or 31 depending on the month I tried to use:
Dim d As Long
d = Cells(3, LastRow2 - 1).Value
MyFormula = "= d-(SUM((COUNTIF($C5:$AG5,{""H"",""S"",""M"",""L"",""W""})))+(COUNTIF(C5:AG5,""AM"")/2)+(COUNTIF(C5:AG5,""PM"")/2))"
This doesn't work I tried in several ways, using debug.print with & and "" but can't seem to get it.
Thanks a lot.
Bookmarks