Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Any Excel Experts on here???

Thread Tools
 
Search this Thread
 
Old 27 October 2003, 09:53 PM
  #1  
DaveMiddleton
Scooby Regular
Thread Starter
 
DaveMiddleton's Avatar
 
Join Date: Mar 2000
Location: Aberdeen
Posts: 633
Likes: 0
Received 0 Likes on 0 Posts
Post

Is there a formula or way to re-number an item in eg a list of items 1-400 so that ALL the subsequent numbers are also re-numbered if you remove one of the items from the list?? HELP!!!
Currently I am manually changing each number if this necessity happens.
Old 27 October 2003, 10:08 PM
  #2  
nkh
Scooby Regular
 
nkh's Avatar
 
Join Date: May 2002
Posts: 633
Likes: 0
Received 0 Likes on 0 Posts
Post

Not completely sure I understand but try this.

Enter =Row(A6) into cell A6 and you get the row number 6
Copy this formula down all the cells and you have automatic numbering.

Obviously you could add an offset if you wanted to start you data not at the first row or from a different number.

Column will return the column number (not letter) if your data is horizontl not vertical.
Old 27 October 2003, 11:57 PM
  #3  
Da Booga
Scooby Regular
 
Da Booga's Avatar
 
Join Date: May 2002
Posts: 732
Likes: 0
Received 0 Likes on 0 Posts
Post

If i've understood right all you need to do is add one to the cell value above i.e. for cell A2 enter the following "=A1+1".

You only need to enter the number 1 in cell A1 then the above in cell 2 then you can just drag the formula down as required.

this will only change the numbers if you completely delete a line that you remove & not just clear the cells.

HTH

Gareth
Old 28 October 2003, 07:24 AM
  #4  
markr1963
Scooby Regular
 
markr1963's Avatar
 
Join Date: Jun 2002
Location: Perth, Western Australia
Posts: 1,866
Likes: 0
Received 0 Likes on 0 Posts
Post

But if you just wanted to clear the cells you could use a bit of code like this attached to a macro:

Selection.ClearContents
h = ActiveCell.Row 'row number of cell just cleared
Selection.End(xlUp).Select
i = ActiveCell.Value 'value of cell immediately above that just cleared
ActiveCell.SpecialCells(xlLastCell).Select
j = ActiveCell.Row 'row number of the last row in list
l = i + 1 ' the next number
For k = h + 1 To j ' loop from cell immediately below that just cleared
If Cells(k, 1).Value = "" Then ' if cell is blank skip it
Else
Cells(k, 1).Value = l 'next number
l = l + 1
End If

Next

HTH

Mark
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Mattybr5@MB Developments
Full Cars Breaking For Spares
28
28 December 2015 11:07 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
12
18 November 2015 07:03 AM
leg200
Subaru Parts
5
07 October 2015 07:31 AM
has-scooby
Subaru Parts
4
06 October 2015 03:47 PM
bluebullet29
General Technical
9
05 October 2015 02:17 PM



Quick Reply: Any Excel Experts on here???



All times are GMT +1. The time now is 09:00 PM.