Formula to a cell

G

Guest

Hi All.......
I am trying to put a formula in a cell and Excel keeps changing it on me......
I use the following line of code....
ActiveCell.FormulaR1C1 = "=Right(CELL(""FILENAME"",A1),4)"

and the formula in the cell turns out to be....
=RIGHT(CELL("FILENAME",'A1'),4)

which is wrong and gives me a #NAME? return.

Any help would be appreciated.

Vaya con Dios,
Chuck, CABGx3
 
G

Guest

Sub clr()
ActiveCell.Value = "=Right(CELL(" & Chr(34) & "FILENAME" & Chr(34) & ",A1),4)"
End Sub
 
C

CLR

That did the trick, kind Sir, and I thank you very much. I used the same
technique to modify another formula in the same boat and it worked fine as
well. I find that whole process rather clumbsy and user hostile, but if it
works, what the hey!..........

Thanks again, muchly...........

Vaya con Dios,
Chuck, CABGx3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top