Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default What's wrong with this code (r1c1 paste)

ActiveCell.FormulaR1C1 =
"=IF(AND((VALUE(YEAR($I6)&MONTH($I6))<=(VALUE(2004 &N$5))),(VALUE(YEAR($J6)&MONTH($J6))=VALUE(2004&N $5))),1,0)"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default What's wrong with this code (r1c1 paste)

For starters, you've used FormulaR1C1, which requires the cell references to
be in R1C1 format. You've used A1 style references. In R1C1 notation, you need
to know the row number and column number of the active in order to convert
them. If the active cell is A1, $I6 is R[5]C9, N$5 is R5C[13]. The numbers
inside the brackets specify the offset from the active cells.

Rather than converting all of them, try using the Formula property instead
<g.


On Wed, 27 Oct 2004 15:19:05 -0700, "mmattson"
wrote:

ActiveCell.FormulaR1C1 =
"=IF(AND((VALUE(YEAR($I6)&MONTH($I6))<=(VALUE(200 4&N$5))),(VALUE(YEAR($J6)&MONTH($J6))=VALUE(2004& N$5))),1,0)"


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default What's wrong with this code (r1c1 paste)

You are using A1 notation and FormulaR1C1, try

ActiveCell.Formula = _
"=IF(AND((VALUE(YEAR($I6)&MONTH($I6))<=(VALUE(2004 &N$5))),(VALUE(YEAR($J6)&M
ONTH($J6))=VALUE(2004&N$5))),1,0)"


--

HTH

RP

"mmattson" wrote in message
...
ActiveCell.FormulaR1C1 =

"=IF(AND((VALUE(YEAR($I6)&MONTH($I6))<=(VALUE(2004 &N$5))),(VALUE(YEAR($J6)&M
ONTH($J6))=VALUE(2004&N$5))),1,0)"



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default What's wrong with this code (r1c1 paste)

Hi Myrna

You wrote:
Rather than converting all of them, try using the Formula property instead
<g.

Is this a way of converting R1C1 back to A1 notation quickly? I noticed the
grin.

TIA

Bob C.

---

"Myrna Larson" wrote:

For starters, you've used FormulaR1C1, which requires the cell references to
be in R1C1 format. You've used A1 style references. In R1C1 notation, you need
to know the row number and column number of the active in order to convert
them. If the active cell is A1, $I6 is R[5]C9, N$5 is R5C[13]. The numbers
inside the brackets specify the offset from the active cells.

Rather than converting all of them, try using the Formula property instead
<g.


On Wed, 27 Oct 2004 15:19:05 -0700, "mmattson"
wrote:

ActiveCell.FormulaR1C1 =
"=IF(AND((VALUE(YEAR($I6)&MONTH($I6))<=(VALUE(200 4&N$5))),(VALUE(YEAR($J6)&MONTH($J6))=VALUE(2004& N$5))),1,0)"



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default What's wrong with this code (r1c1 paste)

No. I meant that changing the function to Formula is much quicker than leaving
it as FormulaR1C1 and figuring out the R1C1 references.

To do the latter, you would stuff your existing formula into a string, then
use the Application.ConvertFormula method to convert it to R1C1



On Wed, 27 Oct 2004 21:01:02 -0700, Robert Christie
wrote:

Hi Myrna

You wrote:
Rather than converting all of them, try using the Formula property instead
<g.

Is this a way of converting R1C1 back to A1 notation quickly? I noticed the
grin.

TIA

Bob C.

---

"Myrna Larson" wrote:

For starters, you've used FormulaR1C1, which requires the cell references

to
be in R1C1 format. You've used A1 style references. In R1C1 notation, you

need
to know the row number and column number of the active in order to convert
them. If the active cell is A1, $I6 is R[5]C9, N$5 is R5C[13]. The numbers
inside the brackets specify the offset from the active cells.

Rather than converting all of them, try using the Formula property instead
<g.


On Wed, 27 Oct 2004 15:19:05 -0700, "mmattson"
wrote:

ActiveCell.FormulaR1C1 =


"=IF(AND((VALUE(YEAR($I6)&MONTH($I6))<=(VALUE(200 4&N$5))),(VALUE(YEAR($J6)&MONTH($J6))=VALUE(2004& N$5))),1,0)"



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
Question on this conversion code switching between r1c1 to A1 format tia sal2 temp Excel Worksheet Functions 1 September 16th 07 06:54 AM
Question on this conversion code switching between r1c1 to A1 format tia sal2 temp Excel Discussion (Misc queries) 2 September 14th 07 08:58 PM
Question on this conversion code switching between r1c1 to A1 format tia sal2 temp Excel Worksheet Functions 2 September 14th 07 08:58 PM
Converting code to R1C1 format Paul Excel Programming 1 April 15th 04 03:48 AM
what's wrong with my code???? cornishbloke[_28_] Excel Programming 5 January 22nd 04 12:10 PM


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