Hi all,
I am running into a Problem regarding circular reference in Excel vba. I am trying to assign a cell, a formula which requires the mentioning of the same cell.
The equation is
f=1/-2*LOG(3.7*k/D + 2.5/Re*sqrt(f))^2
where k and D are constants. As it can be seen, the f appears on both sides of the equation and Needs to be calculated. When I transform above equation to assign as a formula in a cell (say A1), it reads
=1/(-2*LOG(k/D*3,7) + 2,51/(D39*WURZEL(A1+1E-300))))^2
The above formula seems to be working, giving the value of f but everytime i Change the constant, it Shows an error and i Need to go to the formula bar to hit enter again and the value appears again. This is obv undesirable so I thought of writing a Macro which read as follows
ActiveCell.Formula = 1 / (-2 * Log(k/D * 3.7) + (2.51 / Re * Sqr(R1C1 + 1E-300))) ^ 2
surprisingly the above macro does not work at all giving an error.
Any help would be highly appreciated.
Cheers!!!
Bookmarks