ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating an AutoNumber ID as a primary key (https://www.excelbanter.com/excel-programming/417387-creating-autonumber-id-primary-key.html)

Stephan Leduc[_2_]

Creating an AutoNumber ID as a primary key
 
I'm creating a user form where it will push data to an Excel spreadsheet. I
will later link this spreadsheet to MS Access to do some reports.

I need to create a function where for each new line added to a the
spreadsheet, I need to create a unique ID (the row name will be "ID") a
little bit like the AutoNumber in Access.

Thanks in advance for the help.


Bob Phillips[_3_]

Creating an AutoNumber ID as a primary key
 
AutoId = Application.Max(Activesheet.Columns(1)) + 1

--
__________________________________
HTH

Bob

"Stephan Leduc" wrote in message
...
I'm creating a user form where it will push data to an Excel spreadsheet.
I
will later link this spreadsheet to MS Access to do some reports.

I need to create a function where for each new line added to a the
spreadsheet, I need to create a unique ID (the row name will be "ID") a
little bit like the AutoNumber in Access.

Thanks in advance for the help.




Stephan Leduc[_2_]

Creating an AutoNumber ID as a primary key
 
You are Fantastic Bob.

Thanks

Regards

Stephan

"Bob Phillips" wrote:

AutoId = Application.Max(Activesheet.Columns(1)) + 1

--
__________________________________
HTH

Bob

"Stephan Leduc" wrote in message
...
I'm creating a user form where it will push data to an Excel spreadsheet.
I
will later link this spreadsheet to MS Access to do some reports.

I need to create a function where for each new line added to a the
spreadsheet, I need to create a unique ID (the row name will be "ID") a
little bit like the AutoNumber in Access.

Thanks in advance for the help.






All times are GMT +1. The time now is 03:40 AM.

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