Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Formula with an ActiveCell

Hi, I am trying to input a formulae into a cell that
references to an activeCell. Currently this is the
formulae I have in there, but it's giving me errors. Any
thoughts on how I can do this?

ActiveCell.FormulaR1C1 =

"=Cells(32,ActiveCell.Column).Select*(R16C4)*(R9C3 )"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Formula with an ActiveCell

I think you're looking for:

ActiveCell.FormulaR1C1 = _
"=" & Cells(32, ActiveCell.Column).Address(ReferenceStyle:=xlR1C1) _
& "*(R16C4)*(R9C3)"

But since you know the row and column number, this looks simpler:

ActiveCell.FormulaR1C1 = "=r32c" & ActiveCell.Column & "*(r16c4)*(r9c3)"

Both of these put the reference in the cell--not the value. Each of these
result in a formula like:
=$F$32*($D$16)*($C$9)

If you really wanted the value, then maybe:

ActiveCell.FormulaR1C1 = _
"=" & Cells(32, ActiveCell.Column).Value & "*(R16C4)*(R9C3)"

This formula looks like: =33*($D$16)*($C$9)

Sok Hong wrote:

Hi, I am trying to input a formulae into a cell that
references to an activeCell. Currently this is the
formulae I have in there, but it's giving me errors. Any
thoughts on how I can do this?

ActiveCell.FormulaR1C1 =

"=Cells(32,ActiveCell.Column).Select*(R16C4)*(R9C3 )"


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Formula with an ActiveCell

ActiveCell.FormulaR1C1 = _
"=" & Cells(32,ActiveCell.Column).Address(True,True,xlR1 C1) _
& "*(R16C4)*(R9C3)")

--
Regards,
Tom Ogilvy



Sok Hong wrote in message
...
Hi, I am trying to input a formulae into a cell that
references to an activeCell. Currently this is the
formulae I have in there, but it's giving me errors. Any
thoughts on how I can do this?

ActiveCell.FormulaR1C1 =

"=Cells(32,ActiveCell.Column).Select*(R16C4)*(R9C3 )"



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Formula with an ActiveCell

You cannot do that. ActiveCell is a VBA object - not recognised by
normal Excel. You can only access the active cell at runtime with
something like :-
Range("A1").Value = ActiveCell.Value


Regards
BrianB
------------------------------------------



"Sok Hong" wrote in message ...
Hi, I am trying to input a formulae into a cell that
references to an activeCell. Currently this is the
formulae I have in there, but it's giving me errors. Any
thoughts on how I can do this?

ActiveCell.FormulaR1C1 =

"=Cells(32,ActiveCell.Column).Select*(R16C4)*(R9C3 )"

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
ActiveCell.FormulaR1C1 Rick Excel Discussion (Misc queries) 3 March 28th 10 10:36 PM
Using activecell in vlookup csdjj Excel Discussion (Misc queries) 2 June 25th 09 11:31 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
highlight activecell flow23 Excel Discussion (Misc queries) 10 February 21st 06 12:01 PM
Activecell problem [email protected] Excel Discussion (Misc queries) 1 October 26th 05 02:13 PM


All times are GMT +1. The time now is 02:12 PM.

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"