#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default FormulaR1C1


the formula in question is:

Range("C2").Select
Selection.FormulaR1C1 = "=IF(RC2=""C"",RC1,0)"

and my code, unfortunately, looks like this:

Range("C2").Select
Selection.FormulaR1C1 = "=IF(RC2=""C"",RC1,0)"
Range("D2").Select
Selection.FormulaR1C1 = "=IF(RC2=""D"",RC1,0)"
Range("E2").Select
Selection.FormulaR1C1 = "=IF(RC2=""E"",RC1,0)"
Range("F2").Select
...and so on... until ("T2")

and my question is, what do i have to add so that i don't have to writ
the code for each cell

basically i'm looking for a For | Next operator that increases the A t
a B from col. C to D and so on...

sorry for the odd explanation..

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default FormulaR1C1

Sub test()

Dim intCol As Integer

For intCol = 3 To 20
Cells(2, intCol).FormulaR1C1 = "=IF(RC2=""" & Chr(intCol + 64) &
""",RC1,0)"
Next intCol

End Sub

--
HTH,
Dianne

In ,
aapp81 typed:
the formula in question is:

Range("C2").Select
Selection.FormulaR1C1 = "=IF(RC2=""C"",RC1,0)"

and my code, unfortunately, looks like this:

Range("C2").Select
Selection.FormulaR1C1 = "=IF(RC2=""C"",RC1,0)"
Range("D2").Select
Selection.FormulaR1C1 = "=IF(RC2=""D"",RC1,0)"
Range("E2").Select
Selection.FormulaR1C1 = "=IF(RC2=""E"",RC1,0)"
Range("F2").Select
..and so on... until ("T2")

and my question is, what do i have to add so that i don't have to
write
the code for each cell

basically i'm looking for a For | Next operator that increases the A
to
a B from col. C to D and so on...

sorry for the odd explanation...


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from
http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to
creating financial statements



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default FormulaR1C1


thank you very much

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
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
ActiveCell.FormulaR1C1 = "=SUM(R[-tellerteller]C:R[-1]C)" Jack Sons Excel Discussion (Misc queries) 5 September 29th 09 09:58 PM
reference to other worksheets in FormulaR1C1 Stefi Excel Discussion (Misc queries) 6 May 25th 05 09:01 AM
Whats wrong with this VBA statement -ActiveCell.FormulaR1C1...? hal Excel Programming 5 November 8th 03 02:48 AM
ActiveCell.FormulaR1C1 Leif Rasmussen Excel Programming 1 October 16th 03 09:46 AM


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