ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   autonum field (https://www.excelbanter.com/excel-programming/297313-autonum-field.html)

Mark[_40_]

autonum field
 
Hi,
Is it possible to add autonum field in Excel?
Just like in Access. or need some VBA code
to this. Where can I find this sample or article?
Thanks,
Mark



Frank Kabel

autonum field
 
Hi Mark
a real unique autonumbring functionality is not available in Excel. you
may try the following formula approach to number entries (note: they
are NOT fixed attached to a record):
in A1 enter the following formula
=IF(B1<"",1,"")

in A2 enter the formula
=IF(B2<"",MAX($A$1:OFFSET($A2,-1,0))+1,"")
and copy this formula down for as many rows as you like

--
Regards
Frank Kabel
Frankfurt, Germany


Mark wrote:
Hi,
Is it possible to add autonum field in Excel?
Just like in Access. or need some VBA code
to this. Where can I find this sample or article?
Thanks,
Mark



Mark[_40_]

autonum field
 
Thanks.




"Frank Kabel" wrote in message
...
Hi Mark
a real unique autonumbring functionality is not available in Excel. you
may try the following formula approach to number entries (note: they
are NOT fixed attached to a record):
in A1 enter the following formula
=IF(B1<"",1,"")

in A2 enter the formula
=IF(B2<"",MAX($A$1:OFFSET($A2,-1,0))+1,"")
and copy this formula down for as many rows as you like

--
Regards
Frank Kabel
Frankfurt, Germany


Mark wrote:
Hi,
Is it possible to add autonum field in Excel?
Just like in Access. or need some VBA code
to this. Where can I find this sample or article?
Thanks,
Mark






All times are GMT +1. The time now is 12:42 PM.

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