Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default For Next loupe in a worksheetformula

Good Morning

I can't find the answer to my question.
The macro below selects the cells M2 to M30 to place a
Worksheetformula.
That works all right
But at the same time the formula has to raise the sheetnames in the
next cells from Player 2 to
Player 3, Player 4 and so on.
I can't figure out if this is possible at all and if yes how to do
so.
Sheets("Player 1").Select
For x = 2 To 30
Range("M" & x).Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-5]="""","""",IF(AND(RC[-9]=RC[-7],'Player
2'!R6C4='Player 2'!R6C6),1,IF(RC[-9]=RC[-7],2,0)))"
Next x

Looking forward to your answer.

Piet

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default For Next loupe in a worksheetformula

Must be For Next Loop of course

Kweenie schreef:

Good Morning

I can't find the answer to my question.
The macro below selects the cells M2 to M30 to place a
Worksheetformula.
That works all right
But at the same time the formula has to raise the sheetnames in the
next cells from Player 2 to
Player 3, Player 4 and so on.
I can't figure out if this is possible at all and if yes how to do
so.
Sheets("Player 1").Select
For x = 2 To 30
Range("M" & x).Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-5]="""","""",IF(AND(RC[-9]=RC[-7],'Player
2'!R6C4='Player 2'!R6C6),1,IF(RC[-9]=RC[-7],2,0)))"
Next x

Looking forward to your answer.

Piet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default For Next loupe in a worksheetformula

Use this line:
ActiveCell.FormulaR1C1 = _
"=IF(RC[-5]="""","""",IF(AND(RC[-9]=RC[-7],'Player " & x & "'!R6C4='Player "
& x & "'!R6C6),1,IF(RC[-9]=RC[-7],2,0)))"

Regards,
Stefi

"Kweenie" wrote:

Must be For Next Loop of course

Kweenie schreef:

Good Morning

I can't find the answer to my question.
The macro below selects the cells M2 to M30 to place a
Worksheetformula.
That works all right
But at the same time the formula has to raise the sheetnames in the
next cells from Player 2 to
Player 3, Player 4 and so on.
I can't figure out if this is possible at all and if yes how to do
so.
Sheets("Player 1").Select
For x = 2 To 30
Range("M" & x).Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-5]="""","""",IF(AND(RC[-9]=RC[-7],'Player
2'!R6C4='Player 2'!R6C6),1,IF(RC[-9]=RC[-7],2,0)))"
Next x

Looking forward to your answer.

Piet



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default For Next loupe in a worksheetformula

Stefi

Thanks a lot for your answer
I tried the same but probably i mistyped something.

Anyway it works.
Thanks again

Piet


Stefi schreef:

Use this line:
ActiveCell.FormulaR1C1 = _
"=IF(RC[-5]="""","""",IF(AND(RC[-9]=RC[-7],'Player " & x & "'!R6C4='Player "
& x & "'!R6C6),1,IF(RC[-9]=RC[-7],2,0)))"

Regards,
Stefi

"Kweenie" wrote:

Must be For Next Loop of course

Kweenie schreef:

Good Morning

I can't find the answer to my question.
The macro below selects the cells M2 to M30 to place a
Worksheetformula.
That works all right
But at the same time the formula has to raise the sheetnames in the
next cells from Player 2 to
Player 3, Player 4 and so on.
I can't figure out if this is possible at all and if yes how to do
so.
Sheets("Player 1").Select
For x = 2 To 30
Range("M" & x).Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-5]="""","""",IF(AND(RC[-9]=RC[-7],'Player
2'!R6C4='Player 2'!R6C6),1,IF(RC[-9]=RC[-7],2,0)))"
Next x

Looking forward to your answer.

Piet




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default For Next loupe in a worksheetformula

You are welcome! Thanks for the feedback!
Stefi

"Kweenie" wrote:

Stefi

Thanks a lot for your answer
I tried the same but probably i mistyped something.

Anyway it works.
Thanks again

Piet


Stefi schreef:

Use this line:
ActiveCell.FormulaR1C1 = _
"=IF(RC[-5]="""","""",IF(AND(RC[-9]=RC[-7],'Player " & x & "'!R6C4='Player "
& x & "'!R6C6),1,IF(RC[-9]=RC[-7],2,0)))"

Regards,
Stefi

"Kweenie" wrote:

Must be For Next Loop of course

Kweenie schreef:

Good Morning

I can't find the answer to my question.
The macro below selects the cells M2 to M30 to place a
Worksheetformula.
That works all right
But at the same time the formula has to raise the sheetnames in the
next cells from Player 2 to
Player 3, Player 4 and so on.
I can't figure out if this is possible at all and if yes how to do
so.
Sheets("Player 1").Select
For x = 2 To 30
Range("M" & x).Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-5]="""","""",IF(AND(RC[-9]=RC[-7],'Player
2'!R6C4='Player 2'!R6C6),1,IF(RC[-9]=RC[-7],2,0)))"
Next x

Looking forward to your answer.

Piet




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



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