PDA

View Full Version : Solved: Add amount everyday



thair younis
06-23-2012, 04:37 AM
Hi there
I want formula .

1- In cell (C2) i have amount (5000) that amount is always permanent , and want
add to it the remain amount on cell (G2) and that amount always variable

there is attached

Thank you

fredlo2010
06-23-2012, 07:01 AM
Hi,

I am not expert but try this

Sub generate()

Cells(2, 3).Activate

For i = 0 To 10000 Step 11 '<======adjust the 1000 to go as far as you want.

Cells(2 + i, 3).FormulaR1C1 = "=5000+R[-11]C[4]"
Next i

End Sub

thair younis
06-23-2012, 08:07 AM
Hi fredlo2010
Thank you for this macro , but i wanna formula
Thanks again

sassora
06-23-2012, 09:54 AM
In cell C13, put

= 5000+G2

Copy and paste the cell down the page to get the other figures. I have attached the file so you can see.8312

thair younis
06-23-2012, 03:05 PM
Hi sassora
But this is consider manually
sassora i have a form and i everyday just copy this form
to complete my work, so i want put a formula in that form
when i copy this form , i want just input the data not do it manually
i hope my explanation was clear
Thank you

sassora
06-24-2012, 02:32 AM
When you copy the table, the formulas will change automatically. The cell reference is relative. If the formula was "=A1" and you pasted that in the same column, ten rows below then it would update to "=A10".

So in this example:
Compare the first and second tables: they start both in the same column and there is a gap of three rows between them. If this is the same between the second and third then the formula in the amount column will automatically update.

Copy A12:G19 and paste this to A23:G30
The formula in the third table will update so that the figure is 5000 + the 'remain amount' in G13

When you want and new table, just copy and paste in this way below the previous tables

thair younis
06-24-2012, 08:46 AM
Hi sassora
Yes it's working very good
Thank you so much

fredlo2010
06-25-2012, 05:50 AM
Hi thair,

1. I think there is a way to create the fuction we are looking for. maybe one of the experts in the forum will help us with this one.

2. If what you are looking for is automation then you could create a procedure that will add a new table every day.It would be good to take a look at the data you will end up with at the end of the day and whether the amount of rows in the tables will be constant or not.

If the workbook is used as I think it is. ( not sure about it though) you will need a procedure to:

-Check the last date entered in the column and if its different than today's add a new table.
-if not go to the table with todays date

I think I can help you with that but I need the final state of the workbook. :)