ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro needed for assigning serial numbers (https://www.excelbanter.com/excel-worksheet-functions/162224-macro-needed-assigning-serial-numbers.html)

D Hart

Macro needed for assigning serial numbers
 
I need a macro that can enter a serial number in a given row in column A
based upon whether or not there is an entry in the same row in column B.
There are often a number of blank spaces between the entries in column B.

To make matters worse, the number needs to increase by one with each
occurrence.

Is there a macro like this floating around anywhere?

Any help greatly appreciated. I'm a newbie, and am faced with the prospect
of sorting through 60,000 rows, one entry at a time. My boss is growing
impatient :-(

jdh

Max

Macro needed for assigning serial numbers
 
One idea ..
Put in A2: =IF(B2="","",COUNTA(B$2:B2))
Copy down as far as needed
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"D Hart" wrote:
I need a macro that can enter a serial number in a given row in column A
based upon whether or not there is an entry in the same row in column B.
There are often a number of blank spaces between the entries in column B.

To make matters worse, the number needs to increase by one with each
occurrence.

Is there a macro like this floating around anywhere?

Any help greatly appreciated. I'm a newbie, and am faced with the prospect
of sorting through 60,000 rows, one entry at a time. My boss is growing
impatient :-(

jdh


Pete_UK

Macro needed for assigning serial numbers
 
You can do this without a macro, but does your serial number have any
specific conventions attached to it?

For example - is it purely numeric, or a mixture of numbers and
letters? Is it a fixed number of characters/digits, with leading zeros
where necessary (eg 0000001, rather than just 1)? Will it start with 1
and increment by 1 each time? Is the order of your 60,000 rows
important to the numbering?

Also, what columns are occupied by your data, i.e. what is the next
free column?

Pete

On Oct 15, 10:01 pm, "D wrote:
I need a macro that can enter a serial number in a given row in column A
based upon whether or not there is an entry in the same row in column B.
There are often a number of blank spaces between the entries in column B.

To make matters worse, the number needs to increase by one with each
occurrence.

Is there a macro like this floating around anywhere?

Any help greatly appreciated. I'm a newbie, and am faced with the prospect
of sorting through 60,000 rows, one entry at a time. My boss is growing
impatient :-(

jdh





All times are GMT +1. The time now is 08:18 AM.

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