ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Numbering - Starting Over Based on Zero (https://www.excelbanter.com/excel-programming/390241-numbering-starting-over-based-zero.html)

[email protected]

Numbering - Starting Over Based on Zero
 
I have a sheet that is like this:

A B C
content 0 Yes
content
content
content 0 Yes
content
content
content
content
content 0 Yes
content
content
content


What I want to do is number column b as 0,1,2,3,4,5 etc and start over
numbering when it hits a 0.

How would I do that with a macro....or is there an easier way.

Any help would be so appreciated.

Thanks,
Louise


Jim Thomlinson

Numbering - Starting Over Based on Zero
 
Without a macro the easiest way would probably be something like this...

In Cell B2 add the formula =B1 + 1
Copy Cell B2
Highlight the entire area of Column B where you want to add the numbers
(like B1:B100)
Select F5 or Ctrl + G
Select Special Cells
Select Blank Cells
Select OK
All of the blank cells should now be hightlighted
Now just paste the formula.
You may want to copy and paste special values the entire column to
permanenetly set the values...
--
HTH...

Jim Thomlinson


" wrote:

I have a sheet that is like this:

A B C
content 0 Yes
content
content
content 0 Yes
content
content
content
content
content 0 Yes
content
content
content


What I want to do is number column b as 0,1,2,3,4,5 etc and start over
numbering when it hits a 0.

How would I do that with a macro....or is there an easier way.

Any help would be so appreciated.

Thanks,
Louise



[email protected]

Numbering - Starting Over Based on Zero
 
On May 28, 11:34 am, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
Without a macro the easiest way would probably be something like this...

In Cell B2 add the formula =B1 + 1
Copy Cell B2
Highlight the entire area of Column B where you want to add the numbers
(like B1:B100)
Select F5 or Ctrl + G
Select Special Cells
Select Blank Cells
Select OK
All of the blank cells should now be hightlighted
Now just paste the formula.
You may want to copy and paste special values the entire column to
permanenetly set the values...
--
HTH...

Jim Thomlinson

" wrote:
I have a sheet that is like this:


A B C
content 0 Yes
content
content
content 0 Yes
content
content
content
content
content 0 Yes
content
content
content


What I want to do is number column b as 0,1,2,3,4,5 etc and start over
numbering when it hits a 0.


How would I do that with a macro....or is there an easier way.


Any help would be so appreciated.


Thanks,
Louise


Jim,

That is awesome. Worked exactly as I needed.

Thank you for saving me so much time....I have 10,000 lines in my
spreadsheet!

Louise



All times are GMT +1. The time now is 05:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com