View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.newusers
F R A N K
 
Posts: n/a
Default How to create a table with numbers from 1 to 600?

Thank you for the macro suggestion! I'd like a lot to understand them and use
them, but I'm too much newbie I fear... :-(((
Thanks anyway! Ciao :-)))

"Gord Dibben" wrote:

Frank

I realize this is the NewUsers group, but maybe you're willing to try some VBA.

This macro allows you to build a table of numbers in rows and columns.

Your choice of direction and scope.

Sub FillNums()
'to fill rows and columns with numbers from 1 to whatever
Dim nrows As Integer
Dim ncols As Integer
On Error GoTo quitnow
RowsorCols = InputBox("Fill Across = 1" & Chr(13) _
& "Fill Down = 2")
Num = 1
nrows = InputBox("Enter Number of Rows")
ncols = InputBox("Enter Number of Columns")
If RowsorCols = 1 Then
For across = 1 To nrows
For down = 1 To ncols
ActiveSheet.Cells(across, down).Value = Num
Num = Num + 1
Next down
Next across
Else
For across = 1 To ncols
For down = 1 To nrows
ActiveSheet.Cells(down, across).Value = Num
Num = Num + 1
Next down
Next across
End If
quitnow:
End Sub

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo


Gord Dibben MS Excel MVP

On Thu, 15 Jun 2006 13:22:02 -0700, F R A N K
wrote:

Thank you so much, but I need to use both rows and columns. Can you please
help me again? Thanks a lot! :-)))
Ciao

"Ron Coderre" wrote:

If the list of number is all in one column, try something like this:

Enter a 1 in cell A1
Select Cell A1

From the Excel main menu:
<edit<fill<series
Series in: Column
Stop Value: 600
Click the [OK] button

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"F R A N K" wrote:

Hi!
I need to create a table with numbers ranging from 1 to 600. It could be
simpler.
Just automatically filling cells with these numbers in increasing order.
I'm trying with excel, which sould be the most appropriate software to do
that, but I'm very negated with it. Could you please help me?
Thanks a lot, ciao!


Gord Dibben MS Excel MVP