![]() |
Click = Random Charaters Into A Cell
Thanks,
is there a way to make this into such away that when i click the cell the random password is inputted stright away? as i dont want to have to copy and past the formula each time regards, chris "Teethless mama" wrote: =CHAR(RANDBETWEEN(CODE("A"),CODE("Z")))&CHAR(RANDB ETWEEN(CODE("A"),CODE("Z")))&CHAR(RANDBETWEEN(CODE ("a"),CODE("z")))&CHAR(RANDBETWEEN(CODE("a"),CODE( "z")))&CHAR(RANDBETWEEN(CODE("a"),CODE("z")))&CHAR (RANDBETWEEN(CODE("a"),CODE("z")))&CHAR(RANDBETWEE N(CODE("a"),CODE("z")))&RANDBETWEEN(1,9) "Chris" wrote: Hi All, I used a spredsheet to create new users onto our network. We input their name, job title, server and their password they will use to login to windows. Is it possible to make some random charaters appear by clicking on the password cell? EG. Name Job Function Password Server John Smith CSR <CLICK Bristol these passwords have to be in this Format: 2 Uppercase, 5 lower case, 1number. i.e UUlllll1 is this possible? Regards, Chris |
Click = Random Charaters Into A Cell
Chris,
Try this. Right click your sheet tab, view code and paste this in. It works on Column C only and only if the cell is blank. The formula as supplied by Teethless Mama has wrapped so you will have to unwrap it. Double click the cell to get a number. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Target.Value = "" And ActiveCell.Column = 3 Then Target.Formula = "=CHAR(RANDBETWEEN(CODE(""A""),CODE(""Z"")))&CHAR( RANDBETWEEN(CODE(""A""),CODE(""Z"")))&CHAR(RANDBET WEEN(CODE(""a""),CODE(""z"")))&CHAR(RANDBETWEEN(CO DE(""a""),CODE(""z"")))&CHAR(RANDBETWEEN(CODE(""a" "),CODE(""z"")))&CHAR(RANDBETWEEN(CODE(""a""),CODE (""z"")))&CHAR(RANDBETWEEN(CODE(""a""),CODE(""z"") ))&RANDBETWEEN(1,9)" Target.Copy ActiveCell.PasteSpecial xlPasteValues Application.CutCopyMode = False Target.Offset(1, 0).Select End If End Sub Mike "Chris" wrote: Thanks, is there a way to make this into such away that when i click the cell the random password is inputted stright away? as i dont want to have to copy and past the formula each time regards, chris "Teethless mama" wrote: =CHAR(RANDBETWEEN(CODE("A"),CODE("Z")))&CHAR(RANDB ETWEEN(CODE("A"),CODE("Z")))&CHAR(RANDBETWEEN(CODE ("a"),CODE("z")))&CHAR(RANDBETWEEN(CODE("a"),CODE( "z")))&CHAR(RANDBETWEEN(CODE("a"),CODE("z")))&CHAR (RANDBETWEEN(CODE("a"),CODE("z")))&CHAR(RANDBETWEE N(CODE("a"),CODE("z")))&RANDBETWEEN(1,9) "Chris" wrote: Hi All, I used a spredsheet to create new users onto our network. We input their name, job title, server and their password they will use to login to windows. Is it possible to make some random charaters appear by clicking on the password cell? EG. Name Job Function Password Server John Smith CSR <CLICK Bristol these passwords have to be in this Format: 2 Uppercase, 5 lower case, 1number. i.e UUlllll1 is this possible? Regards, Chris |
All times are GMT +1. The time now is 01:34 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com