Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Incrementing Cell Numbers

Hi,

I would like the output of my code to start in "A1" and either store
data laterally "B1", "C1" etc or vertically i.e. "A2", "A3" etc etc.


could someone help me with the relevant command?

- D

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Incrementing Cell Numbers

Sub Macro1()
For i = 1 To 100
Cells(1, i) = i
Next
End Sub

will put your incrementing numbers across and

Sub Macro1()
For i = 1 To 100
Cells(i,1) = i
Next
End Sub

will put the numbers down the first column
--
Gary''s Student


"den1s" wrote:

Hi,

I would like the output of my code to start in "A1" and either store
data laterally "B1", "C1" etc or vertically i.e. "A2", "A3" etc etc.


could someone help me with the relevant command?

- D


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default Incrementing Cell Numbers

You can place A1 into cell A1 and use the fill handle to populate
the cells to the right and then drag downward on fill handle to fill down.
http://www.mvps.org/dmcritchie/excel/fillhandle

The quickest way though is with a macro that simply puts the cell
address into each cell and is great for testing as you can see where
a cell was move from when sorting, inserting, deleting.

See MarkCells and MarkSepAreas macros (work on selection area(s))
http://www.mvps.org/dmcritchie/excel/join.htm#markcells
http://www.mvps.org/dmcritchie/excel...m#marksepareas

You can see how I have my menus set up in
http://www.mvps.org/dmcritchie/excel/barhopper.htm

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"den1s" wrote
I would like the output of my code to start in "A1" and either store
data laterally "B1", "C1" etc or vertically i.e. "A2", "A3" etc etc.



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
Incrementing numbers problem AJ Excel Worksheet Functions 1 May 23rd 09 03:25 AM
Incrementing numbers in cells Andrew Morine Excel Worksheet Functions 1 August 26th 08 02:11 AM
Incrementing numbers Floyd107 Excel Worksheet Functions 2 February 28th 06 10:04 AM
Table of incrementing by one numbers brbarto New Users to Excel 2 December 20th 05 03:16 AM
Incrementing Cell Numbers Lance W. Grimes Excel Discussion (Misc queries) 1 March 8th 05 07:51 PM


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