Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default [Beginner's] Increasing numbers in a table

Please give full code for a macro that gives the user a user-friendly
way to determine a number, then makes this number the value of a
certain cell and increases the number for a certain range of cells,
like this:

http://img136.imageshack.us/img136/8185/numbers.gif

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Increasing numbers in a table

Try this it does what your example shows

Sub Button1_Click()
Dim s As String
s = InputBox("What is the number")
Range("A1") = s
Range("B1:D1").FormulaR1C1 = "=RC[-1]+20"
Range("A1:D1").AutoFill Destination:=Range("A1:D20"),
Type:=xlFillDefault
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Increasing numbers in a table

On 7 Mar, 17:12, CurlyDave wrote:
Try this it does what your example shows

Sub Button1_Click()
* * Dim s As String
* * s = InputBox("What is the number")
* * Range("A1") = s
* * Range("B1:D1").FormulaR1C1 = "=RC[-1]+20"
* * Range("A1:D1").AutoFill Destination:=Range("A1:D20"),
Type:=xlFillDefault
End Sub


Actually, that doesn't work - "Syntax error".
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Increasing numbers in a table


"pnumminen" ha scritto nel messaggio
...
On 7 Mar, 17:12, CurlyDave wrote:
Try this it does what your example shows

Sub Button1_Click()
Dim s As String
s = InputBox("What is the number")
Range("A1") = s
Range("B1:D1").FormulaR1C1 = "=RC[-1]+20"
Range("A1:D1").AutoFill Destination:=Range("A1:D20"),
Type:=xlFillDefault
End Sub


Actually, that doesn't work - "Syntax error".

Sub Button1_Click()
Dim s As String
s = InputBox("What is the number")
Range("A1") = s
Range("B1:D1").FormulaR1C1 = "=RC[-1]+20"
Range("A1:D1").AutoFill Destination:=Range("A1:D20"), Type:=xlFillDefault
'<== change this line
End Sub

Look to the sintax at commented row (before last row).
Regards,
John


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Increasing numbers in a table

On Mar 8, 9:03*am, pnumminen wrote:
On 7 Mar, 17:12, CurlyDave wrote:

Try this it does what your example shows


Sub Button1_Click()
* * Dim s As String
* * s = InputBox("What is the number")
* * Range("A1") = s
* * Range("B1:D1").FormulaR1C1 = "=RC[-1]+20"
* * Range("A1:D1").AutoFill Destination:=Range("A1:D20"),
Type:=xlFillDefault
End Sub


Actually, that doesn't work - "Syntax error".


Sometimes, when pasting code to the forum, the lines get split, if a
line is in red when you paste the code in the VBA editor, chances are
that the line of code is split and you will have to join it.


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
Increasing numbers. pawnraider Excel Discussion (Misc queries) 3 May 21st 09 12:45 PM
Increasing and decreasing numbers by 5% ....also showing a loss Karen Excel Discussion (Misc queries) 2 April 12th 09 03:44 AM
How do I copy a formula with increasing worksheet numbers Harrison_05 Excel Discussion (Misc queries) 2 April 30th 06 12:57 AM
Increasing Sheet Numbers by one on fill down command albertmb Excel Worksheet Functions 1 March 12th 06 08:41 AM
Increasing numbers in a column by percentage dekare Excel Worksheet Functions 1 December 29th 05 08:45 PM


All times are GMT +1. The time now is 08:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"