Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Relative/Absolute Formula writing in to a cell.

Hi,

In the below example z= 2.

If I put,

ActiveCell.Formula = "= " & Cells(z, "d").Address

Then in Cell H8, I get the formula as -- = $D$2 --

How do I modify my formula such that I get the value as -- = D2 --

Actually I dont want hard-coded/fixed referencing.

Thanks a lot,
Hari
India


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Relative/Absolute Formula writing in to a cell.

Hi,

I recorded a macro for writing formula with absolute/half-absolute
references and got the following

Range("D15").Select
ActiveCell.FormulaR1C1 = "=R[-3]C[-2]"
Range("G17").Select
ActiveCell.FormulaR1C1 = "=R14C2"
Range("C18").Select
ActiveCell.FormulaR1C1 = "=R12C[-1]"
Range("B20").Select
ActiveCell.FormulaR1C1 = "=R[-6]C1"
Range("D21").Select
ActiveCell.FormulaR1C1 = "=R[-14]C[-1]"
Range("D22").Select

I can understand now that for my purpose I will have to use R1C1 method but
my problem is that I need to transform -- Cells(z, "d").Address -- where z
is a variable of for loop... How do I do it?

Please guide me.


Thanks a lot,
Hari
India

"Hari Prasadh" wrote in message
...
Hi,

In the below example z= 2.

If I put,

ActiveCell.Formula = "= " & Cells(z, "d").Address

Then in Cell H8, I get the formula as -- = $D$2 --

How do I modify my formula such that I get the value as -- = D2 --

Actually I dont want hard-coded/fixed referencing.

Thanks a lot,
Hari
India



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
Absolute and Relative Cell References Karen Excel Discussion (Misc queries) 1 April 1st 09 09:41 AM
Relative (vs. Absolute) Cell References with macros Claude S. Weiller Excel Discussion (Misc queries) 1 August 3rd 06 08:56 PM
Formula - relative or absolute ref, keeps changing Hoib New Users to Excel 5 July 23rd 05 01:21 AM
F4 key does not toggle relative/absolute cell references. java Excel Worksheet Functions 2 July 12th 05 09:53 PM
Explanation Relative/Absolute Cell Reference Cath Excel Worksheet Functions 1 March 6th 05 04:10 AM


All times are GMT +1. The time now is 04:25 AM.

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

About Us

"It's about Microsoft Excel"