Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Duplicating Formulas

My problem is when i enter a number into a cell i want a formula to be
inserted underneath this cell. The formula will entered that number of
times. My formula is
2*3.14*(A1+B1)/2
This formula is entered in the first cell
The next cell will be
2*3.14*(a1+b1+b1)/2
B1 will be added twice and then in the next cell B1 will be added three
times and so on until the number in that was entered is reached.
Anybody got any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Duplicating Formulas

I would add an auxilary column to the spreadsheet that has the numbers 1,
2,3,...

Row Column A Column B Column C
1 =2*3.14*(A1+(C1 * B1))/2 1
2 =2*3.14*(A2+(C2 * B2))/2 2
3 =2*3.14*(A3+(C3 * B3))/2 3
4 =2*3.14*(A4+(C4 * B4))/2 4
5 =2*3.14*(A5+(C5 * B5))/2 5

You can also use the row function instead of adding the column
=2*3.14*(A1+(row(A1) * B1))/2





"enyaw" wrote:

My problem is when i enter a number into a cell i want a formula to be
inserted underneath this cell. The formula will entered that number of
times. My formula is
2*3.14*(A1+B1)/2
This formula is entered in the first cell
The next cell will be
2*3.14*(a1+b1+b1)/2
B1 will be added twice and then in the next cell B1 will be added three
times and so on until the number in that was entered is reached.
Anybody got any ideas?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Duplicating Formulas

Here is an example using C1 as the number to duplicate the formula:

Sub DupFormula()
Dim i As Long
Dim rng As Range

i = Range("C1").Value 'change to your cell

For i = 1 To i
Set rng = Cells(i + 1, 3) 'reference to your cell
rng.Formula = "=2*3.14*(A1+(B1*" & i & "))/2"
Next
End Sub

Mike F

"enyaw" wrote in message
...
My problem is when i enter a number into a cell i want a formula to be
inserted underneath this cell. The formula will entered that number of
times. My formula is
2*3.14*(A1+B1)/2
This formula is entered in the first cell
The next cell will be
2*3.14*(a1+b1+b1)/2
B1 will be added twice and then in the next cell B1 will be added three
times and so on until the number in that was entered is reached.
Anybody got any ideas?



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
Duplicating check boxes with formulas wcollatz Excel Worksheet Functions 1 May 4th 09 12:30 AM
Sheets duplicating Abby Excel Worksheet Functions 2 January 19th 06 08:48 PM
De-duplicating Peter Excel Discussion (Misc queries) 1 August 4th 05 05:32 PM
duplicating excel formulas mark Excel Discussion (Misc queries) 1 December 29th 04 01:47 PM
duplicating formulas without updating Wazooli Excel Worksheet Functions 3 December 16th 04 04:27 PM


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