Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default 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
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
Autofill column values in formulas NOV Michael S Excel Discussion (Misc queries) 4 October 9th 09 05:50 PM
autofill grambo Excel Discussion (Misc queries) 1 October 9th 06 02:55 AM
How can I isolate a lookup vectors but not values from autofill? rjpeltz Excel Worksheet Functions 2 May 15th 06 07:41 PM
Autofill Dolphinv4 Excel Discussion (Misc queries) 2 October 21st 05 12:34 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM


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