random password generator

Trevor3007

Well-known Member
Joined
Jan 26, 2017
Messages
667
Office Version
  1. 365
Platform
  1. Windows
hi,

I have very very limited VB skills and want to create a list of random passwords within a set range (ie a2..a500)

Must be 9 characters in length a mixture of alpha(lower case) and numbers between 1-9.

I really appreciate your help & thank you in advance.


KR
Trevor3007
 
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
google is your friend > type this into it > random password generator excel
 
Upvote 0
Code:
[color=darkblue]Sub[/color] Random_Passwords()
    [color=darkblue]Static[/color] IsRandomized [color=darkblue]As[/color] [color=darkblue]Boolean[/color]
    [color=darkblue]Dim[/color] r [color=darkblue]As[/color] [color=darkblue]Integer[/color], i [color=darkblue]As[/color] [color=darkblue]Integer[/color]
    [color=darkblue]Dim[/color] cell [color=darkblue]As[/color] Range, PW [color=darkblue]As[/color] [color=darkblue]String[/color]
    
    [color=darkblue]If[/color] [color=darkblue]Not[/color] IsRandomized [color=darkblue]Then[/color] Randomize: IsRandomized = [color=darkblue]True[/color]
    
    [color=darkblue]For[/color] [color=darkblue]Each[/color] cell [color=darkblue]In[/color] Range("A2:A500")
        PW = vbNullString
        [color=darkblue]For[/color] i = 1 [color=darkblue]To[/color] 9
            r = Int((35 * Rnd) + 1)
            [color=darkblue]Select[/color] [color=darkblue]Case[/color] r
                [color=darkblue]Case[/color] 1 [color=darkblue]To[/color] 9: PW = PW & r             [color=green]' 1 to 9[/color]
                [color=darkblue]Case[/color] 10 [color=darkblue]To[/color] 35: PW = PW & Chr(r + 87) [color=green]' Lower case alpha[/color]
            [color=darkblue]End[/color] [color=darkblue]Select[/color]
        [color=darkblue]Next[/color] i
        cell.Value = PW
    [color=darkblue]Next[/color] cell
    
[color=darkblue]End[/color] [color=darkblue]Sub[/color]
 
Last edited:
Upvote 0
hi

thanks for your help. Yeah looked to google, but its a case of close, but no cigar. Also, your [CODE ]Put Your Code[/ CODE] is that into VB or a cell?

MTA
Trevor3007
 
Upvote 0
hi

thanks for your help. Yeah looked to google, but its a case of close, but no cigar. Also, your [CODE ]Put Your Code[/ CODE] is that into VB or a cell?

MTA
Trevor3007

CODE TAGS do what AlphaFrog did around the offering, as for close, that is what adaption and learning is all about, bespoke software is written for corporations
 
Upvote 0
thanks for your help & advice.

I have now resolved this & a BIG thanks to Alphafrog.

have a great day !
 
Upvote 0
WOW, thank you Alphafrog you are the VB master.


absolutely fantastic & works exactly how I hoped it would.

MTA & hope you have a great day.
 
Upvote 0
BTW the current suggestions is for THREE Random Words

QUOTE Traditionally, the ultimate strong password is considered to be long and containing a multitude of symbols, numbers and capital letters. Although quite secure as a password, most of us have found them to be far from memorable. This lack of memorability means that people either choose weak passwords instead or they compromise them by writing them down. This behavioural reality was a key factor in the Government’s research into passwords and the subsequent recommendations made in a recently published paper called Password Guidance – simplifying your approach (opens new window). The advice to use or include three random words in your password is a culmination of pragmatism and algorithmic strength against common issues like brute force attacks – where hackers use software to churn passwords out until it discovers the correct one. It’s about choosing three random words that mean something to you and therefore can be remembered. It’s avoiding the most common sources of passwords like your children’s and partner’s name. It’s using different passwords for those key accounts like your email and banking. It’s not compromising your work and home systems by using the same password for both.
 
Upvote 0
hi

very interesting. These codes are temporary and will be changed accordingly at a later date. They will not be used as the 'primary' password & other security measures are in force too.

I have now resolved my issue & all thanks to 1 & all at Mr Excel.

Have a great day.

KR
Trevor3007
 
Last edited:
Upvote 0
Hi AlphaFrog,

thank you soo much for sorting my 'random password generator'

however, it has just came to light that each password should only contain 1 letter & the letters should not be duplicated within the password ( ie 1qwertyz ). i hope you can solve ...sorry also to ask.

 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,795
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top