Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 19th, 2007, 01:47 AM
Authorized User
 
Join Date: Apr 2007
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Fill down series

I want to have the series like 1,2,3,4,5,6,7, etc in a column named S.No. in Excel, automatically through VBA.

Yogesh

Yogesh
__________________
Yogesh
 
Old April 23rd, 2007, 08:44 AM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 163
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Is the number always sequential and always starting with 1 (1, 2, 3...)? If so you could just use a formula either placed by code or put in a cell and auto populated down.

If you want a sequential number that auto numbers when auto populated/copied then use this formula in the cell:

=row() - 3

This assumes that the detail row starts in row 4.


For doing this in VBA:
---------------------------------------
Range("A4:A33").value = "=row() - 3"
---------------------------------------
The above will put the number 1 through 30 in column A from row 4 through 33.

Does this help?

 
Old April 24th, 2007, 03:56 AM
Authorized User
 
Join Date: Apr 2007
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had spend so many time for this little thing. Thnks.

Yogesh

Yogesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA macro, Area chart data series fill svif Excel VBA 1 June 5th, 2008 04:17 PM
Data series in reports singhswat Reporting Services 2 April 20th, 2008 10:37 PM
Taylor series Koshe Need help with your homework? 1 April 16th, 2006 09:25 AM
Is parent first element in series cedar XSLT 2 June 8th, 2005 10:34 AM
Help with series of cell ref in lookup robinlostutter Excel VBA 2 April 28th, 2005 05:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.