View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Roger Govier[_3_] Roger Govier[_3_] is offline
external usenet poster
 
Posts: 2,480
Default Generating a primary key

Hi

In cell A2 enter a formula like
=IF(B2="","","Key"&TEXT(ROW(),"00000"))
and copy down

Before copying to Access, select the range of cells in column A for the
number of rows to be copiedCopyPaste SpecialValues


--
Regards
Roger Govier

"Access::Student" wrote in message
...
So I'm doing something for a client that probably isn't the best way, but
the
client insists to have it that way. The client wants to work primarily out
of
an excel spreadsheet then periodically export the data to an access
database
that includes extra information about the records.

The problem I'm having is transferring them from excel to access since I
obviously need a key to uniquely identify each record. Since the client is
working in excel the primary key has to be generated in excel and be
transfered to access later.

I can't figure out a reliable way to generate an automatic identifier on
the
fly in excel. I've found a lot of forums posts with the same problem but
don't seem to completely understand any of the solutions.

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html

I have seen the previous link come up many times but I don't know if it's
the best implementation for my project. The excel spreadsheet is stored on
a
shared network drive if the affect the solution to the problem.

Thanks for any help.