Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default cell reference in formula

Hi Gogo,

Try this

For a = 2 To 18
Range("B" & a).FormulaR1C1 = "=sheet1!R[" & (a - 1) * 2 & "]C"
Next a


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"gogo" wrote in message
...
hi
here is what's troubles me. the code below doesn't work but it helps you

understand. i want that cell in (sheet2,B2) have a value of cell in
(sheet1,B2), cell in (sheet2,B3) have a value of cell in (sheet1,B4) ... and
so. the pattern is: columns are same but rows in sheet2 are continues, and
in sheet2 goes by even numbers - 2,4,6,8...
For a = 2 To 18 // a

=number of row in sheet2
i = (a - 1) * 2 // i

=even number sequence[i]
Range("B" & a).Select
ActiveCell.FormulaR1C1 = "=sheet1!RC" // here is question:

how to reference a variable index "i"
Next a

tnx in advance



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default cell reference in formula

a =
tnx Bob for help with "=sheet1!R[" & (a - 1) * 2 & "]C". this helped a lo
rearraged my macro and this do the work

d1 =
d2 =
k =
D
Range("B" & (a + d1 + 1)).Selec
ActiveCell.FormulaR1C1 = "=Original!R[" & (a + d2) - k & "]C
k = k +
d1 = d1 +
d2 = d2 +
Loop Until (d2 34)
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default cell reference in formula

Good, a win-win.

Bob

"gogo" wrote in message
...
a = 0
tnx Bob for help with "=sheet1!R[" & (a - 1) * 2 & "]C". this helped a lot
rearraged my macro and this do the work.

d1 = 1
d2 = 2
k = 2
Do
Range("B" & (a + d1 + 1)).Select
ActiveCell.FormulaR1C1 = "=Original!R[" & (a + d2) - k & "]C"
k = k + 1
d1 = d1 + 1
d2 = d2 + 2
Loop Until (d2 34)



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
format a cell with a formula so an empty reference cell shows blan M2 Excel Discussion (Misc queries) 3 November 7th 06 10:42 PM
Using a cell reference within a cell reference in a formula david Excel Worksheet Functions 2 July 1st 06 01:05 PM
How do I leave formula cell blank if 2nd reference cell is empty? Liana S Excel Discussion (Misc queries) 2 October 21st 05 04:38 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM


All times are GMT +1. The time now is 04:17 PM.

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"