Just for future reference.
If you have a working formula in a cell and you want it in code, do as follows:
Select the cell with the working formula.
Developer, Record Macro, yes to the suggested macro name
F2
Enter
Developer, Stop recording.
Go to your macro that you just recorded and you'll see the formula in code.
Bookmarks