Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell address within formula

Hello,

I would like to have a formula entered into a cell which references the
address of another cell, already determined by VBA variables. I have tried
different combinations of code but can only get the referenced cell's value,
or the referenced cell's address with single quotes around it, which doesn't
work. Here's a bit of my code...

Dim T1cell, T2cell, T3cell As Range

For Each c In Range("J2:J" & Rws)
If c.Value = "1 Total" Then Set T1cell = c.Offset(, 2)
If c.Value = "2 Total" Then Set T2cell = c.Offset(, 2)
If c.Value = "3 Total" Then Set T3cell = c.Offset(, 2)
Next c

Other code here...

If Tier = 1 Then
USDcell.FormulaR1C1 = "=if(" & T1cell.Address & "<0,RC[-4]*0.03,0)"
ElseIf Tier = 2 Then
USDcell.FormulaR1C1 = "=if(" & T2cell.Address & "<0,RC[-4]*0.05,0)"
ElseIf Tier = 3 Then
USDcell.FormulaR1C1 = "=if(" & T3cell.Address & "<0,RC[-4]*0.08,0)"
End If

Any ideas?

Thanks,
Nate Kolman
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
Formula for Cell address Elton Law[_2_] Excel Worksheet Functions 3 April 8th 09 05:23 PM
Formula without cell address Billy Rogers Excel Discussion (Misc queries) 6 May 14th 08 12:59 AM
Cell Address in Formula Laury Excel Discussion (Misc queries) 2 October 8th 07 06:23 PM
cell address from formula JohnJC Excel Discussion (Misc queries) 1 June 14th 06 12:11 PM
address of cell formula is in mark kubicki Excel Programming 5 January 26th 04 02:59 AM


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