#1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Rolling rows

today i got stumped on what i thought would be a piece of cake.

i want to have a range of cells in a column numbered 1,2,3... i then
want to be able to insert a row, say between 2 and 3 and have the
numbers below it add one to the count as well as the correct number in
that cell auto fill in for the row just added. so that rather than have
1,2,blank,3 i would now get 1,2,3,4

in other words, recreate the functionality of the row number off to the
left.

i can make a range where if cell a1 is 1 then a2 could be a function of
a1+1. this sequence however does not auto-fill when i add a new row -
it just places a blank without rolling over the numbers.

i'm going nuts - i hope someone can give me a clever solution!

ras

  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default Rolling rows

this assumes that you have a title row in row 1 and numbers in cell a2 and
cell a3. Now when you insert a row and/or add anything in col B the numbers
will be re-created automatically.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 2 Then Exit Sub
lr = Cells(Rows.Count, "b").End(xlUp).Row
Range(Cells(2, 1), Cells(3, 1)).AutoFill _
Range(Cells(2, 1), Cells(lr, 1))
End Sub


--
Don Guillett
SalesAid Software

wrote in message
ups.com...
today i got stumped on what i thought would be a piece of cake.

i want to have a range of cells in a column numbered 1,2,3... i then
want to be able to insert a row, say between 2 and 3 and have the
numbers below it add one to the count as well as the correct number in
that cell auto fill in for the row just added. so that rather than have
1,2,blank,3 i would now get 1,2,3,4

in other words, recreate the functionality of the row number off to the
left.

i can make a range where if cell a1 is 1 then a2 could be a function of
a1+1. this sequence however does not auto-fill when i add a new row -
it just places a blank without rolling over the numbers.

i'm going nuts - i hope someone can give me a clever solution!

ras



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
Rows & Columns in Excel seadragon69 Excel Worksheet Functions 2 December 7th 05 05:54 PM
Automatically inserting rows ausdiver99 Excel Worksheet Functions 1 June 2nd 05 02:15 PM
Hiding Rows if the linked rows are blank KG Excel Discussion (Misc queries) 9 May 18th 05 02:32 AM
Insert rows Mr. G. Excel Worksheet Functions 3 March 31st 05 03:49 AM
flexible paste rows function that inserts the right number of rows marika1981 Excel Discussion (Misc queries) 1 February 18th 05 02:40 AM


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