Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Formula to a cell

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Formula to a cell

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

--
Gary's Student
gsnu200704


"CLR" wrote:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Formula to a cell

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


"Gary''s Student" wrote in message
...
Sub clr()
ActiveCell.Value = "=Right(CELL(" & Chr(34) & "FILENAME" & Chr(34) &

",A1),4)"
End Sub

--
Gary's Student
gsnu200704


"CLR" wrote:

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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I make a blank cell in a formula cell with a range of cell Vi Excel Discussion (Misc queries) 5 June 21st 07 02:46 PM
Subtract cell formula from existing cell formula [email protected] Excel Programming 2 December 12th 06 12:03 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM
Question: Cell formula or macro to write result of one cell to another cell Frederik Romanov Excel Programming 1 July 8th 03 03:03 PM


All times are GMT +1. The time now is 03:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"