[ EXCEL ] Storing a cell formula in VBA
Posted on 2003-03-17
In VBA I want to grab a formula in a cell of my worksheet, save it in a string so that later I can affect it to an other cell,I'm unable to grab the formula and if i put it staticly in VBA it always put a space in front of my equal sign so it see's it like text.
I don't want to do a:
Because I want to save it for later. Her is my code
Dim CellC2 As String
Dim Formula As string
CellC2 = Cells(2, 3) ' this only transfer the result, not the formula
'This is the formula in my Cells, I save it staticly
Formula = "=""Au "" & TEXT(IF(WEEKDAY(TODAY())=2;TODAY()-3;TODAY()-1);""jj mmmm aaaa"")"
Cells(3, 3).Value = Formula ' Save it in C3 but it put a space in front of the equal sign, so it's interpreted as text
Thank you very much for your help