ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Please help. poss VBA (https://www.excelbanter.com/excel-programming/361687-please-help-poss-vba.html)

Clash

Please help. poss VBA
 

Hi all,

I have been trying to get a unique ID for a number of entries on m
spreadsheet, the way I have came up with this is Initial first name
Initial second name, date of birth & initial of gender.

It looks like this L-F-12/10/1966-M, but now the number of entries o
the spreadsheet is getting greater and greater daily and it would b
nice to automate this feature to save a bit of time.

Is there a way that this can be done, your help is greatl
appreciated.

Cheer

--
Clas
-----------------------------------------------------------------------
Clash's Profile: http://www.excelforum.com/member.php...fo&userid=1895
View this thread: http://www.excelforum.com/showthread.php?threadid=54283


[email protected]

Please help. poss VBA
 
Assuming first name is in column A, second name is in column B, date of
birth is in column C and Gender is in column D (as M or F) then in
column E put the formula
=Left(A1,1)&"-"&Left(B1,1)&"-"&C1&"-"&D1

regards
Paul


bgeier[_10_]

Please help. poss VBA
 

how is your data laid out?
where should it be going

first name is in cell A1 (First)
Second name is in cell A2 (Second)
Birthdate is in cell A3 99/99/9999
Gender is in cell A4 Gender

a formula such as

= LEFT(N26,1) & LEFT(N27,1) & N28 & LEFT(N29,1)

would give you FS99/99/99G

or if you want the "-"

=LEFT(N26,1) & "-" & LEFT(N27,1) & "-" & N28 & "-" & LEFT(N29,1)

would give you F-S-99/99/9999-

--
bgeie
-----------------------------------------------------------------------
bgeier's Profile: http://www.excelforum.com/member.php...fo&userid=1282
View this thread: http://www.excelforum.com/showthread.php?threadid=54283


Clash

Please help. poss VBA
 

Thanks both,

but there seems to be another problem.

The date is being shown as five numbers, as if the cell hasn't been
formated.

i.e. J-L-29288-M

I have tried to format the cell which the formula is in, but nothing.


--
Clash
------------------------------------------------------------------------
Clash's Profile: http://www.excelforum.com/member.php...o&userid=18951
View this thread: http://www.excelforum.com/showthread...hreadid=542839


[email protected]

Please help. poss VBA
 
Hi
Try
=Left(A1,1)&"-"&Left(B1,1)&"-"&text(C1,"dd/mm/yy")&"-"&D1

regards
Paul


Clash

Please help. poss VBA
 

Paul, you are a star !!

Thanks very much.


--
Clash
------------------------------------------------------------------------
Clash's Profile: http://www.excelforum.com/member.php...o&userid=18951
View this thread: http://www.excelforum.com/showthread...hreadid=542839



All times are GMT +1. The time now is 10:58 PM.

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