Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default VBA r1c1 absolute previous row in formula

Hi, I get an error message when I run this code:

ActiveCell.FormulaR1C1 = "=round(R-1C*RC[7],2)"

I need to use the cell directly above the cell the where the pointer is. If
I don't make it an absolute reference it works fine but I need it to be an
absolute as the formula gets copied down. Also, this gets used threw out the
routine so I can't hard set the cell above.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default VBA r1c1 absolute previous row in formula

ActiveCell.FormulaR1C1 = "=round(R[-1]C*RC[7],2)"

"SLP" wrote:

Hi, I get an error message when I run this code:

ActiveCell.FormulaR1C1 = "=round(R-1C*RC[7],2)"

I need to use the cell directly above the cell the where the pointer is. If
I don't make it an absolute reference it works fine but I need it to be an
absolute as the formula gets copied down. Also, this gets used threw out the
routine so I can't hard set the cell above.

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default VBA r1c1 absolute previous row in formula

ActiveCell.FormulaR1C1 = "=round(R" & activecell.row & "C*RC[7],2)"

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


"SLP" wrote in message
...
Hi, I get an error message when I run this code:

ActiveCell.FormulaR1C1 = "=round(R-1C*RC[7],2)"

I need to use the cell directly above the cell the where the pointer is.
If
I don't make it an absolute reference it works fine but I need it to be an
absolute as the formula gets copied down. Also, this gets used threw out
the
routine so I can't hard set the cell above.

Thanks.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default VBA r1c1 absolute previous row in formula

of course that should have been

ActiveCell.FormulaR1C1 = "=round(R" & activecell.row - 1 & "C*RC[7],2)"

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Niek Otten" wrote in message
...
ActiveCell.FormulaR1C1 = "=round(R" & activecell.row & "C*RC[7],2)"

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


"SLP" wrote in message
...
Hi, I get an error message when I run this code:

ActiveCell.FormulaR1C1 = "=round(R-1C*RC[7],2)"

I need to use the cell directly above the cell the where the pointer is.
If
I don't make it an absolute reference it works fine but I need it to be
an
absolute as the formula gets copied down. Also, this gets used threw out
the
routine so I can't hard set the cell above.

Thanks.



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
R1C1 Formula Paul W Smith Excel Programming 2 August 19th 09 01:03 PM
Formula R1C1 kay Excel Programming 3 December 4th 08 05:09 PM
Addition string from input box in to a formula (eg;R1C1 Formula) Dev Excel Programming 0 January 25th 07 05:32 PM
Combining R1C1 and absolute reference in SUMPRODUCT in VBA Cornelia Excel Programming 1 June 15th 06 10:30 PM
Absolute reference in R1C1 notation Tim C Excel Programming 2 August 14th 03 11:54 PM


All times are GMT +1. The time now is 05:07 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"