Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
autofill values
In a userform, i have a textbox asking user to fill in Sales Value
(e.g. 10,000) Then i have another text box asking to fill in Sales growth(e.g., 10). HOw do i write a code which will transfer the sales value(10,000)to cell A1, after which from A2 onwards, the value will be 11,000, which is 110% of A1, A3 will be 110% of A2 and so on for A4, A5........? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
autofill values
As with many of these, its a good idea to record a macro
& then examine the resultant code. Assuming a button named btnOK, then try something akin to this: Sub btnOK_Click() Range("A1") = txtStartValue Range("A2").FormulaR1C1 = _ "=R[-1]C+R[-1]C*" & txtIncrease / 100 Range("A2").AutoFill _ Destination:=Range("A2:A20"), _ Type:=xlFillDefault End Sub where txtStartValue=10000 txtIncrease=10 the results a A2 := 11000 A3 := 12100 A4 := 13310 .... A20 := 61159 Patrick Molloy Microsoft Excel MVP -----Original Message----- In a userform, i have a textbox asking user to fill in Sales Value (e.g. 10,000) Then i have another text box asking to fill in Sales growth(e.g., 10). HOw do i write a code which will transfer the sales value (10,000)to cell A1, after which from A2 onwards, the value will be 11,000, which is 110% of A1, A3 will be 110% of A2 and so on for A4, A5........? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autofill column values in formulas | Excel Discussion (Misc queries) | |||
autofill | Excel Discussion (Misc queries) | |||
How can I isolate a lookup vectors but not values from autofill? | Excel Worksheet Functions | |||
Autofill | Excel Discussion (Misc queries) | |||
Autofill: Need to autofill one week block, (5) weekday only into cells. | Excel Discussion (Misc queries) |