Генератор паролей excel vba

excel_vba_password_generator

A utility using rnd() and rank() to generate passwords that comply with multiple rules.

This password generator was written because a.) I wanted to solve some string manipulation problems and b.) I was bored.

This example workbook generates passwords that follow these rules/contraints:

  • It uses upper case letters.
  • It uses lower case letters.
  • It uses digits.
  • It uses special characters (punctuation).
  • It lets you set a minimum number of total characters.
  • It lets you set a minimum number of each character type (upper, lower, digits, special).
  • It will not print dictionary words (other than brr and hmm and the like)
  • It will not print two contiguous characters of the same type.
  • It will not duplicate any character in the password.

While the idea of a password generator may seem straightforward, it actually is straightforward. But it’s not quick. There were several hurdles I had to overcome that made me backtrack a few times and even delete code to rewrite it from scratch. In the end, I was surprised at how simple it was overall. In total, I spent about 14 hours creating this. There are lots of lessons you can take from the code in this.

I think the thing that I learned the most from was combining Excel VBAs rand() and rank() procedures to come up with truly randomized character sets (passwords).

You can also take the library file and import it to your own project if you want to add a password generator to it.

Hello Excellers, welcome back to another blog post in my #Excel #MacroMonday series. Today let’s write our own Excel macro function that will generate a random string of characters. This random string generator or password generator can be helpful to create unique passwords of any given length automatically at any time. If you’re looking for a way to create unique passwords that are still easy to remember, we’ve got the perfect solution.

Table of contents

  • Preparing To Write The Macro.
    • More About Your Personal Macro Workbook (PMW).
  • Starting The Macro.
  • Function Procedures.
  • Declaring Variables.
  • Message Box Warning.
  • Specify The Array Values And Characters.
  • Selecting Characters Individually To Generate The Random String.
  • The Function Result. Generate A Random String!.
  • Ending The Function.
  • What Is An Excel Add-In?.
  • Install the Add-In To Generate A Random String.

Preparing To Write The Macro.

First, you will need to open the Visual Basic Editor. There are two ways to do this. Either by hitting ALT +F11 or selecting the Developer Tab | Code Group | Visual Basic. Both methods have the same result.

You then choose to either create a module to store your code either in your Personal Macro Workbook or in your current workbook or create a UDF or User Defined Function as we are writing our Function or Formula.

What’s the difference?. If you save the macro in your Personal Macro workbook, it will be available for use in any of my Excel workbooks. If you store it in the current workbook, then use is restricted to that workbook. As we write a UDF or user-defined function, we can make it available as just another regular function or formula in Excel. We do this by saving it as an Exel Add-In.

I want to be able to use this macro at any time to generate a password. So I will save this as an Excel Add-In.

More About Your Personal Macro Workbook (PMW).

If you want to read more about your Excel PMW then check out my blog posts below.

Macro Mondays -Creating and Updating Your Personal Macro Workbook

Macro Mondays – Create A Shortcut To Your Personal Excel Macro Workbook

Why Is My Personal Macro Workbook Not Loading Automatically?

Starting The Macro.

generate random string

Function Procedures.

So, in the way that every Sub procedure begins with the words Sub, Functions always start with the word Function and end with the phrase End Function. So, we begin to write our code by typing Function and the name we want to call your function. In this example, I want to call my function PasswordString.

Function PasswordString (Length As Integer)
End Function

Declaring Variables.

We now need to declare three variables for this Function. By declaring these variables, Excel creates memory containers for each of these values.

Dim Strings As Variant, x As Long, str As String

Message Box Warning.

We need the user to enter a value into the length argument of the function to be greater than zero. If the value is not greater than zero, a message box pops up to warn the user to enter the correct value to enter, a value greater than zero characters.

If Length <1 Then
    MsgBox "Length variable must be greater than 0"
    Exit Function
  End If

Specify The Array Values And Characters.

This next piece of code specifies the array of characters and values that Excel can use to generate the string for the password randomly. We declared at the beginning of the function that this value is a Variant. A variant is a particular data type that can contain any kind of data except fixed-length. Excel can therefore generate the random password string made of numbers and characters, precisely what we want in a password.

Strings = Array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", _
  "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", _
  "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "!", "@", _
  "#", "$", "%", "^", "&amp;", "*", "A", "B", "C", "D", "E", "F", "G", "H", _
  "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", _
  "W", "X", "Y", "Z")

Selecting Characters Individually To Generate The Random String.

First, Excel sets the length of the generated password by using x=1 to length, which is the length of the password specified in the functions only argument.

For x = 1 To Length
    Randomize
    str = str &amp; Strings(Int((UBound(Strings) - LBound(Strings) + 1) * Rnd + LBound(Strings)))
  Next x

The Function Result. Generate A Random String!.

The result of the randomized string is then returned and displayed as a typical result in the Excel cell.

Ending The Function.

Excel generates the random string. At this point, the code and also the Function ends.

At last, it is now time to test the function. Great, it looks good. That is how to generate a random string in Excel. A great way to generate Excel passwords.

generate a random string in Excel for password

Finally, it is now time to make this Function available in any of my Excel workbooks. We do this by creating an Excel Add-In.

What Is An Excel Add-In?.

An Excel add-in is simply a File with an extension of .xlam or .xll. Files are loaded up when Excel starts up and contain VBA code (.xlam extensions) that add extra functionality. They usually save you time and or help you avoid errors. While there are Add-Ins that are already available, and there are many Add-Ins that are a lot of third-party Add-Ins – a lot of them are free to download. Just take a look around. So, follow the steps below to convert our UDF to re-use.

  • Click on the File Tab
  • Select Info (Excel 2016)
  • Next, click on the Title and Comments – These are the pieces of information that a user sees and uses when they are loading the Add-In.

random string generator

  • Fill in these fields with something appropriate and informative to the user
  • FInally, click Save As and select the file extension .xlam
  • The name you choose here will be the name of the Add-In
  • The file path automatically is changed.You can keep this location or change it

Excel add in generate random string for a password

Install the Add-In To Generate A Random String.

  • Open a new workbook
  • Developer Tab | Add-Ins | Excel Add-Ins
  • Select your Add-In and hit Ok in the dialog box. In this example it is Generate A Rndom String.
  • The Add-In will now be activated.  Your personal random string generator.

Excel  add in random string generator in Excel

That’s it. Your very own random string generator. A simple piece of VBA can turn into something really useful. Easy as that. Would you find this useful? Likewise, please share in the comments below and let me know if you have used the random string generator.

If you want more Excel and VBA tips then sign up to my monthly Newsletter where I share 3 Excel Tips on the first Wednesday of the month and receive my free Ebook, 50 Excel Tips.

free Excel tips.

Likewise, if you want to see all of the blog posts in the Macro Mondays Series Click The Link Below

How To Excel At Excel – Macro Mondays Blog Posts.

Learn Excel Dashboard Course

So, Don’t forget to SUBSCRIBE to the How To Excel At Excel Newsletter for more tips the first Wednesday of the month.

Let me know in the comments below if you would like the free Excel Password Generator.

Оценка: 99.2%5 Голосов

Общая

Если вам необходимо создать случайные пароли для списка пользователей то этот макрос вам поможет.

Сохраняем файл excel как Книга Excel с поддержкой макросов (*xlsm). Вызываем сочетанием клавиш Alt+F11 Microsoft Visual Basic For Applications, в окне Project кликаем правой кнопкой мыши, выбираем Insert — Module и вставляем следующее:


Function CREATEPASS(Optional LENGTH As Integer = 8, Optional USE_SYMBOL As Boolean = False) As String
    Dim i As Integer
    Dim simb As String * 1
    Dim arrsimb As Integer
    Dim password As String
    Randomize
    If USE_SYMBOL = False Then
       For i = 1 To LENGTH
           arrsimb = Int(Rnd * 3)
           Select Case arrsimb
              Case 0
                  simb = Int(Rnd * 9)
              Case 1
                  simb = Chr(Int((90 - 65 + 1) * Rnd + 65))
              Case 2
                  simb = Chr(Int((122 - 97 + 1) * Rnd + 97))
           End Select
           password = password & simb
      Next
   Else
      For i = 1 To LENGTH
          simb = Chr(Int((126 - 33 + 1) * Rnd + 33))
          password = password & simb
      Next
   End If
   CREATEPASS = password
End Function

Для генерации цифро-буквенного пароля в ячейке вводим: =CREATEPASS(10), где 10 — длина пароля;

Для генерации более сложного пароля включающего в том числе и знаки вводим: =CREATEPASS(10;"True").

  • Просмотров: 7012

Содержание

  1. Генератор паролей в excel
  2. Подскажите пожалуйста как создать генератор паролей в Excel??Желательно на примере, чтобы понятнее было
  3. Excel — Генератор паролей
  4. Генератор случайных комбинаций (VBA)
  5. Генератор паролей (запись в шаблон Word, Excel или Блокнот) + справка
  6. Нужно создать генератор паролей. Желательно в EXEL.
  7. Генератор паролей в Excel
  8. Онлайн-сервисы для генерации паролей
  9. Генерация паролей вExcel при помощи формул
  10. ФункцияVBA для генерации простых паролей
  11. Генератор паролей заданной сложности
  12. Access Excel VBA generate random password or random characters
  13. Access Excel VBA generate random password or random characters
  14. Gather requirement of random password
  15. Access Excel VBA Custom Function – generate random password
  16. Syntax of wRandomPassword – generate random password
  17. Example of wRandomPassword – generate random password
  18. Result
  19. Generate Password without password policy requirement
  20. Небольшой макрос Excel для генерации случайного пароля
  21. Общая
  22. A Function To Generate A Random String Set In Excel.
  23. Table of contents
  24. Preparing To Write The Macro.
  25. More About Your Personal Macro Workbook (PMW).
  26. Starting The Macro.
  27. Function Procedures.
  28. Declaring Variables.
  29. Message Box Warning.
  30. Specify The Array Values And Characters.
  31. Selecting Characters Individually To Generate The Random String.
  32. The Function Result. Generate A Random String!.
  33. Ending The Function.
  34. What Is An Excel Add-In?.
  35. Install the Add-In To Generate A Random String.
  36. Comments

Генератор паролей в excel

Подскажите пожалуйста как создать генератор паролей в Excel??Желательно на примере, чтобы понятнее было

Excel — Генератор паролей

​ «C», «D», «F»,​​x = Array(«0»,​ s(z) & s(z)​ латиницы​Cells(u + 1,​ New Collection​:​ = Worksheets(«Лист1»).Range(«A» &​ 2 и 5​ тогда ваш пароль​ быть : цифровые,​
​ 2007 будут разные​
​2 условие -​ начал добавлять условия,​DevAlone​Вот код, не​Serge_007​ «G», «H», «J»,​
​ «1», «2», «3»,​
​ & s(z) &​’Application.Volatile​ 1).Formula = cl(u)​Dim RandomCombination$, CountOfCombinations&,​аналитика​ Y).Value + Chr(Int(10​ символ в паролях​ будет состоять из​ буквенные, смешанные​ формулы​ Использование символов каждого​ ограничение ввода, что​: Экстрасенс в отпуске,​ могу исправить ошибку,​: Немного другое, но​ «K», «L», «M»,​ «4», «5», «6»,​ s(z) _​Select Case i:​Next​ CountOfSymbols&, u&, SymNum​
​, надеюсь на вашу​ * Rnd +​
​ — цифры, остальные​ цифр, больших латинских​
​Самый простой -​

​Татьяна шеховцова​​ вида по 2шт.​

​ буквы нельзя вводить​​ какая ошибка?​ Помогите пожалуйста:C++ #include​ в эту же​ «N», «P», _​

​ «7», «8», «0»)​​& s(z) &​​ Case 0: i​​End Sub​ As Integer​

​ помощь.​​ 48)) Else Worksheets(«Лист1»).Range(«A»​

Генератор случайных комбинаций (VBA)

​ в единую цепь​​3 условие -​ разбираться, как он​ char *code; short​

​ ||(value> len; do​​Мне нужна ваша​»0″, «1», «2»,​»Q», «R», «S»,​ & s(z) &​ _​

Генератор паролей (запись в шаблон Word, Excel или Блокнот) + справка

​ имеет 3 значения​​On Error Resume​
​ комбинаций из символов​ 10 минут​
​ Randomize For Y​ (ЦЕЛОЕ (СЛЧИС ()*(90-65)+65));ЦЕЛОЕ​7375998​Шведов сергей​ Использование выборочных символов.​ работает. И ты​
​ len; short amount;​ < cout 32);​ помощь!​ «3», «4», «5»,​
​ «T», «V», «W»,​ s(z) & s,​& s(z) &​ _​ Next​ латиницы и арабских​выручайте;(​ = 1 To​ (СЛЧИС ()*9))​А эта формула​: http://excel-training.ru/generator-paroley-v-excel/​ Список составить в​ так и не​ std::cout > amount;​ int sum; std::cout​Мне нужно, чтобы​ «6», «7», «8»,​ «X», «Z», «A»,​ i)​ s(z) & s(z)​-1 в комбинации​Do​ цифр (опционально).​аналитика​

​ 10 Worksheets(«Лист1»).Range(«A» &​​W87N3DL​ позволит выдавать в​

​на базе этого​​ ручную. Исключение например​ сказал, в чём​ std::cout > len;​ >sum; readValue(sum); code​ пароли которые я​ «0»)​ «E», «I», «O»,​End Function​ & s(z) &​ присутствуют цифры и​RandomCombination = rndm(CountOfSymbols,​Максимальное кол-во 40​: вот так?​ Y).Value = «»​mraz​ случайном порядке большие​=ЦЕЛОЕ (СЛЧИС ()*100)&СИМВОЛ​ таких » №​ ошибка.​ code = new​ = new char​ генерирую, записывались в​t = x((Int(1​ «U», «Y»)​Function s$(Optional z​ s(z) & s(z)​

​ буквы латиницы _​​ SymNum)​ символов (есть возможность​mraz​ For I =​: При нажатие на​ латинские буквы​ (СЛУЧМЕЖДУ (33;126))&СИМВОЛ (СЛУЧМЕЖДУ​ ; : ?​Solovaekx​ char [len]; for​

​ [len]; for (int​​ шаблон Word, Excel​ + (Rnd() *​t = x((Int(1​ As Integer =​

Нужно создать генератор паролей. Желательно в EXEL.

​ & s(z) &​1 в комбинации​

​cl.Add RandomCombination, RandomCombination​ добавить).​: эмм, не совсем,​ 0 To 6​ кнопку генерируются пароли​=СИМВОЛ (ЦЕЛОЕ (СЛЧИС​ (33;126))&СИМВОЛ (СЛУЧМЕЖДУ (33;126))&ЦЕЛОЕ​ l | ​: А что я​ (int i(0); i!=amount;​ i(0); i!=amount; i++)<​ и Блокнот (по​

​ 46))) — 1)​ + (Rnd() *​ -1)​ s(z) _​ присутствуют только цифры​Loop While cl.Count​Может кому пригодится.​ при нажатие на​

​ If I =​​ в столбце «A»​ ()*(90-65)+65))​
​ (СЛЧИС ()*100)​ ][<>/>​ копирую?, лол, я​

​End Select​​ 26))) — 1)​Dim x, t$​& s(z) &​ _​ <> CountOfCombinations​Код​ кнопку должно выглядить​

​ 1 Or I​​ в ячейках «от​
​LRFAPEQ​
​Успехов!​Abram pupkin​ попросил, мне накинули​ i(0); i!=len; i++)<​
​ i!=len; i++)< code[i]​

Источник

Генератор паролей в Excel

Для создания большого количества цифровых, буквенных либо смешанных значений, таких, например, как логины и пароли существует несколько подходов, отличающихся друг от друга удобством, простотой использования и способностью влиять на конечный результат.

Онлайн-сервисы для генерации паролей

Существует множество сервисов, которые позволяют формировать безопасные, надежные пароли в режиме онлайн. Одни позволяют сгенерировать один пароль, другие генерируют сразу по десять, третьи позволяют пользователю задавать количество создаваемых паролей. Как правило, все сервисы дают возможность выбора длины пароля и групп символов из которых этот пароль будет состоять. Многие сервисы позволяют разделять прописные и строчные буквы, русские и латинские, а также подставлять в пароль специальные знаки и исключать повторяющиеся символы.

Генерация паролей в Excel при помощи формул

Используя стандартные функции Excel, такие, как СЛЧИС, СЛУЧМЕЖДУ, СИМВОЛ, ЦЕЛОЕ и другие, можно создать функции для генерации паролей разной степени сложности. В сети встречаются различные способы реализации решения этой задачи. Для создания пароля из 6 символов, состоящего из латинских букв, цифр и знаков можно использовать, например, формулу:

=СЦЕПИТЬ(СИМВОЛ(СЛУЧМЕЖДУ(33;126)); СИМВОЛ(СЛУЧМЕЖДУ(33;126)); СИМВОЛ(СЛУЧМЕЖДУ(33;126)); СИМВОЛ(СЛУЧМЕЖДУ(33;126)); СИМВОЛ(СЛУЧМЕЖДУ(33;126)); СИМВОЛ(СЛУЧМЕЖДУ(33;126)))

Функция VBA для генерации простых паролей

Генератор паролей заданной сложности

Надстройка для Excel – это программа, написанная на встроенном в приложения Office языке программирования VBA. Надстройка устанавливается в Excel, расширяет его возможности и позволяет генерировать любое количество паролей, логинов, кодов и любых других буквенно-цифровых значений заданной длины и любой сложности.

Надстройка дает возможность быстро заполнить ячейки выделенного диапазона случайными значениями, гибко настроить сложность этих значений, установить нужную длину и выбрать группы символов, из которых значения будут состоять (цифры, специальные символы, строчные буквы латиницы, строчные буквы кириллицы, заглавные буквы латиницы и заглавные буквы кириллицы). Количество символов ограничено максимально возможной длиной значения ячейки, количество значений соответствует количеству ячеек выделенного диапазона.

Источник

Access Excel VBA generate random password or random characters

This Access Excel VBA tutorial explains how to generate random password or random characters with random number, random letters and random symbols.

You may also want to read:

Access Excel VBA generate random password or random characters

If you are a system administrator, very likely you need to genrate login password for users. Some people who are not good at Excel generate password combination that has a pattern which is predictable by other users. In order to generate a truly random password that cannot be guessed by anyone, it is easier to write a VBA custom Function.

In my previous post, I have explained how to generate random characters, so in this post I will focus on generate random password.

Gather requirement of random password

Many companies have password policy, the most common one is password must have 8 characeters with at least 1 upper & lower alphabets + number + symbol.

To generate such combination, the easiest way is to define which character is what character type. For example, the combination can be like this:

1st char 2nd char 3rd char 4th char 5th char 6th char 7th char 8th char
any a-z A-Z 0-9 symbol any any any

Now the question is how we generate each character type.

Access Excel VBA Custom Function – generate random password

The custom function below allows you to select which random character type you want to generate.

Syntax of wRandomPassword – generate random password

RndType Explanation
1 generate any characters
2 generate a-z or A-Z
3 generate a-z
4 generate A-Z
5 generate 0-9
6 generate symbols

Example of wRandomPassword – generate random password

Back to the previous password requirement below

1st char 2nd char 3rd char 4th char 5th char 6th char 7th char 8th char
any a-z A-Z 0-9 symbol any any any

In Excel worksheet, we can type the below formula

Result

Generate Password without password policy requirement

If you don’t have any requirement on the password, then we can

Источник

Небольшой макрос Excel для генерации случайного пароля

Оценка: 99.2 % — 5 Голосов

Общая

Если вам необходимо создать случайные пароли для списка пользователей то этот макрос вам поможет.

Сохраняем файл excel как Книга Excel с поддержкой макросов (*xlsm) . Вызываем сочетанием клавиш Alt+F11 Microsoft Visual Basic For Applications, в окне Project кликаем правой кнопкой мыши, выбираем Insert — Module и вставляем следующее:

Function CREATEPASS(Optional LENGTH As Integer = 8, Optional USE_SYMBOL As Boolean = False) As String
Dim i As Integer
Dim simb As String * 1
Dim arrsimb As Integer
Dim password As String
Randomize
If USE_SYMBOL = False Then
For i = 1 To LENGTH
arrsimb = Int(Rnd * 3)
Select Case arrsimb
Case 0
simb = Int(Rnd * 9)
Case 1
simb = Chr(Int((90 — 65 + 1) * Rnd + 65))
Case 2
simb = Chr(Int((122 — 97 + 1) * Rnd + 97))
End Select
password = password & simb
Next
Else
For i = 1 To LENGTH
simb = Chr(Int((126 — 33 + 1) * Rnd + 33))
password = password & simb
Next
End If
CREATEPASS = password
End Function

Для генерации цифро-буквенного пароля в ячейке вводим: =CREATEPASS(10) , где 10 — длина пароля;

Для генерации более сложного пароля включающего в том числе и знаки вводим: =CREATEPASS(10;»True») .

Источник

A Function To Generate A Random String Set In Excel.

August 2, 2021 by Barbara

Hello Excellers, welcome back to another blog post in my #Excel #MacroMonday series. Today let’s write our own Excel macro function that will generate a random string of characters. This random string generator or password generator can be helpful to create unique passwords of any given length automatically at any time. If you’re looking for a way to create unique passwords that are still easy to remember, we’ve got the perfect solution.

Table of contents

Preparing To Write The Macro.

First, you will need to open the Visual Basic Editor. There are two ways to do this. Either by hitting ALT +F11 or selecting the Developer Tab | Code Group | Visual Basic. Both methods have the same result.

You then choose to either create a module to store your code either in your Personal Macro Workbook or in your current workbook or create a UDF or User Defined Function as we are writing our Function or Formula.

What’s the difference?. If you save the macro in your Personal Macro workbook, it will be available for use in any of my Excel workbooks. If you store it in the current workbook, then use is restricted to that workbook. As we write a UDF or user-defined function, we can make it available as just another regular function or formula in Excel. We do this by saving it as an Exel Add-In.

I want to be able to use this macro at any time to generate a password. So I will save this as an Excel Add-In.

More About Your Personal Macro Workbook (PMW).

If you want to read more about your Excel PMW then check out my blog posts below.

Starting The Macro.

Function Procedures.

So, in the way that every Sub procedure begins with the words Sub, Functions always start with the word Function and end with the phrase End Function. So, we begin to write our code by typing Function and the name we want to call your function. In this example, I want to call my function PasswordString.

Declaring Variables.

We now need to declare three variables for this Function. By declaring these variables, Excel creates memory containers for each of these values.

Message Box Warning.

We need the user to enter a value into the length argument of the function to be greater than zero. If the value is not greater than zero, a message box pops up to warn the user to enter the correct value to enter, a value greater than zero characters.

Specify The Array Values And Characters.

This next piece of code specifies the array of characters and values that Excel can use to generate the string for the password randomly. We declared at the beginning of the function that this value is a Variant. A variant is a particular data type that can contain any kind of data except fixed-length. Excel can therefore generate the random password string made of numbers and characters, precisely what we want in a password.

Selecting Characters Individually To Generate The Random String.

First, Excel sets the length of the generated password by using x=1 to length, which is the length of the password specified in the functions only argument.

The Function Result. Generate A Random String!.

The result of the randomized string is then returned and displayed as a typical result in the Excel cell.

Ending The Function.

Excel generates the random string. At this point, the code and also the Function ends.

At last, it is now time to test the function. Great, it looks good. That is how to generate a random string in Excel. A great way to generate Excel passwords.

Finally, it is now time to make this Function available in any of my Excel workbooks. We do this by creating an Excel Add-In.

What Is An Excel Add-In?.

An Excel add-in is simply a File with an extension of .xlam or .xll. Files are loaded up when Excel starts up and contain VBA code (.xlam extensions) that add extra functionality. They usually save you time and or help you avoid errors. While there are Add-Ins that are already available, and there are many Add-Ins that are a lot of third-party Add-Ins – a lot of them are free to download. Just take a look around. So, follow the steps below to convert our UDF to re-use.

  • Click on the File Tab
  • Select Info (Excel 2016)
  • Next, click on the Title and Comments – These are the pieces of information that a user sees and uses when they are loading the Add-In.

  • Fill in these fields with something appropriate and informative to the user
  • FInally, click Save As and select the file extension .xlam
  • The name you choose here will be the name of the Add-In
  • The file path automatically is changed.You can keep this location or change it

Install the Add-In To Generate A Random String.

  • Open a new workbook
  • Developer Tab | Add-Ins | Excel Add-Ins
  • Select your Add-In and hit Ok in the dialog box. In this example it is Generate A Rndom String.
  • The Add-In will now be activated. Your personal random string generator.

That’s it. Your very own random string generator. A simple piece of VBA can turn into something really useful. Easy as that. Would you find this useful? Likewise, please share in the comments below and let me know if you have used the random string generator.

If you want more Excel and VBA tips then sign up to my monthly Newsletter where I share 3 Excel Tips on the first Wednesday of the month and receive my free Ebook, 50 Excel Tips.

Likewise, if you want to see all of the blog posts in the Macro Mondays Series Click The Link Below

Let me know in the comments below if you would like the free Excel Password Generator.

Is it possible to download e copy of the excel file ? I have tried to recreate it but not able to call the function from within the cell.

Источник

This Access Excel VBA tutorial explains how to generate random password or random characters with random number, random letters and random symbols.

You may also want to read:

Excel VBA generate non-duplicated random number

Excel VBA Rnd Function to generate random number

If you are a system administrator, very likely you need to genrate login password for users. Some people who are not good at Excel generate password combination that has a pattern which is predictable by other users. In order to generate a truly random password that cannot be guessed by anyone, it is easier to write a VBA custom Function.

In my previous post, I have explained how to generate random characters, so in this post I will focus on generate random password.

Gather requirement of random password

Many companies have password policy, the most common one is password must have 8 characeters with at least 1 upper & lower alphabets + number + symbol.

To generate such combination, the easiest way is to define which character is what character type. For example, the combination can be like this:

1st char 2nd char 3rd char 4th char 5th char 6th char 7th char 8th char
any a-z A-Z 0-9 symbol any any any

Now the question is how we generate each character type.

Access Excel VBA Custom Function – generate random password

The custom function below allows you to select which random character type you want to generate.

Public Function wRandomPassword(Optional rndType = 1) As String
   Randomize
   Select Case rndType
     Case 1  'generate any characters
       wRandomPassword= Chr(Int((126 - 33 + 1) * Rnd + 33))
     Case 2  'generate a-z or A-Z
       randVariable = Int((122 - 65 + 1) * Rnd + 65)
       Do While randVariable > 90 And randVariable < 97
         randVariable = Int((122 - 65 + 1) * Rnd + 65)
       Loop
       wRandomPassword= Chr(randVariable)
     Case 3  'generate a-z
       wRandomPassword= Chr(Int((122 - 97 + 1) * Rnd + 97))
     Case 4  'generate A-Z
       wRandomPassword= Chr(Int((90 - 65 + 1) * Rnd + 65))
     Case 5  'generate 0-9
       wRandomPassword= Chr(Int((57 - 48 + 1) * Rnd + 48))
     Case 6 'generate symbols
       wRandomPassword= Chr(Int((47 - 33 + 1) * Rnd + 33))            
   End Select
End Function

Syntax of wRandomPassword – generate random password

wRandomPassword(Optional rndType = 1)
RndType Explanation
1 generate any characters
2 generate a-z or A-Z
3 generate a-z
4 generate A-Z
5 generate 0-9
6 generate symbols

Example of wRandomPassword – generate random password

Back to the previous password requirement below

1st char 2nd char 3rd char 4th char 5th char 6th char 7th char 8th char
any a-z A-Z 0-9 symbol any any any

In Excel worksheet, we can type the below formula

=wRandomPassword()&wRandomPassword(3)&wRandomPassword(4)&wRandomPassword(5)&wRandomPassword(6)&wRandomPassword()&wRandomPassword()&wRandomPassword()

Result

Generate Password without password policy requirement

If you don’t have any requirement on the password, then we can

Public Function wRandomPassword() As String
   Randomize
   For i = 1 To 8
     tempStr = tempStr & Chr(Int((126 - 33 + 1) * Rnd + 33))
   Next i

  wRandomPassword = tempStr
End Function

Result

Outbound References

https://support.office.com/en-us/article/char-function-bbd249c8-b36e-4a91-8017-1c133f9b837a

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
200?'200px':''+(this.scrollHeight+5)+'px');">Sub GenerateRandomCombinations()
Dim cl As New Collection
Dim RandomCombination$, CountOfCombinations&, CountOfSymbols&, u&, SymNum As Integer
CountOfCombinations = [f1].Value
CountOfSymbols = [f2].Value
SymNum = [f3].Value
If CountOfSymbols ^ 9 < CountOfCombinations Then: MsgBox "Возможных уникальных комбинаций меньше чем требуется": Exit Sub:
On Error Resume Next
Do
RandomCombination = rndm(CountOfSymbols, SymNum)
cl.Add RandomCombination, RandomCombination
Loop While cl.Count <> CountOfCombinations
For u = 0 To cl.Count
Cells(u + 1, 1).Formula = cl(u)
Next
End Sub
Function rndm$(Optional i& = 14, Optional z As Integer = -1)
' i - целое число. Количество символов в комбинации. Максимум 40. Опционально.
' z - имеет 3 значения _
-1 в комбинации присутствуют цифры и буквы латиницы _
1 в комбинации присутствуют только цифры _
0 в комбинации присутствуют только буквы латиницы
'Application.Volatile
Select Case i: Case 0: i = 14: Case Is > 40: i = 40: End Select
rndm = Left(s(z) & s(z) & s(z) & s(z) & s(z) & s(z) & s(z) _
& s(z) & s(z) & s(z) & s(z) & s(z) & s(z) & s(z) & s(z) _
& s(z) & s(z) & s(z) & s(z) & s(z) & s(z) & s(z) & s(z) _
& s(z) & s(z) & s(z) & s(z) & s(z) & s(z) & s(z) & s(z) _
& s(z) & s(z) & s(z) & s(z) & s(z) & s(z) & s(z) & s(z) & s, i)
End Function
Function s$(Optional z As Integer = -1)
Dim x, t$
Select Case z
 
Case 1
x = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "0")
t = x((Int(1 + (Rnd() * 10))) - 1)
Case 0
x = Array("B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", _
"Q", "R", "S", "T", "V", "W", "X", "Z", "A", "E", "I", "O", "U", "Y")
t = x((Int(1 + (Rnd() * 26))) - 1)
Case -1
x = Array("B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", _
"Q", "R", "S", "T", "V", "W", "X", "Z", "A", "E", "I", "O", "U", "Y", _
"0", "1", "2", "3", "4", "5", "6", "7", "8", "0", _
"0", "1", "2", "3", "4", "5", "6", "7", "8", "0")
t = x((Int(1 + (Rnd() * 46))) - 1)
End Select
s = t
t = ""
End Function

Подскажите пожалуйста как создать генератор паролей в Excel??Желательно на примере, чтобы понятнее было

​Смотрите также​​: Надо указывать каким​ идею !​ code[i] = text[rand()%36];​
​ = text[rand()%36]; }​ быть приветствие, дата​
​s = t​
​Case -1​Select Case z​ s(z) & s(z)​
​0 в комбинации​For u =​200?’200px’:»+(this.scrollHeight+5)+’px’);»>Sub GenerateRandomCombinations()​
​ так:​ = 4 Then​
​ 1 до 10″,​
​если цифру 65​Abram pupkin​ пользуешься офисом.​1 условие — Длинна​
​ } code[len] =​ code[len] = »;​
​ создания справки паролей​
​t = «»​x = Array(«B»,​Case 1​ & s(z) &​ присутствуют только буквы​ 0 To cl.Count​Dim cl As​
​mraz​ Worksheets(«Лист1»).Range(«A» & Y).Value​
​ из 7 символов,​
​ заменить на 33​: генераторы паролей могут​Для 2003 и​ 8 символов​
​ »; outkey И​ outkey​ и номер справки.​
​End Function​

Excel — Генератор паролей

​ «C», «D», «F»,​​x = Array(«0»,​ s(z) & s(z)​ латиницы​Cells(u + 1,​ New Collection​:​ = Worksheets(«Лист1»).Range(«A» &​ 2 и 5​ тогда ваш пароль​ быть : цифровые,​
​ 2007 будут разные​
​2 условие -​ начал добавлять условия,​DevAlone​Вот код, не​Serge_007​ «G», «H», «J»,​
​ «1», «2», «3»,​
​ & s(z) &​’Application.Volatile​ 1).Formula = cl(u)​Dim RandomCombination$, CountOfCombinations&,​аналитика​ Y).Value + Chr(Int(10​ символ в паролях​ будет состоять из​ буквенные, смешанные​ формулы​ Использование символов каждого​ ограничение ввода, что​: Экстрасенс в отпуске,​ могу исправить ошибку,​: Немного другое, но​ «K», «L», «M»,​ «4», «5», «6»,​ s(z) _​Select Case i:​Next​ CountOfSymbols&, u&, SymNum​
​, надеюсь на вашу​ * Rnd +​
​ — цифры, остальные​ цифр, больших латинских​
​Самый простой -​

​Татьяна шеховцова​​ вида по 2шт.​

​ буквы нельзя вводить​​ какая ошибка?​ Помогите пожалуйста:C++ #include​ в эту же​ «N», «P», _​

​ «7», «8», «0»)​​& s(z) &​​ Case 0: i​​End Sub​ As Integer​

​ помощь.​​ 48)) Else Worksheets(«Лист1»).Range(«A»​

CyberForum.ru

Генератор случайных комбинаций (VBA)

​ — англ. буквы.​​ букв и почти​ это цифровой​
​: Excel для этого​ Цифры-2шт, Заглвные 2шт,​
​ и отрицательные числа,​
​Solovaekx​ #include #include #include​ тему: http://www.excelworld.ru/board/vba/udf/random_letters/8-1-0-16​»Q», «R», «S»,​
​t = x((Int(1​ s(z) & s(z)​ = 14: Case​
​Function rndm$(Optional i&​
​CountOfCombinations = [f1].Value​
​аналитика​
​ & Y).Value =​Нужно сделать так:​
​ всех знаков​A1=ЦЕЛОЕ (СЛЧИС ()*9)​ не предназначен​
​ спецсивол - 2шт,​
​ и не могу​
​: Я взял за​
​ using namespace std;​SkyPro​ "T", "V", "W",​ + (Rnd() *​ & s(z) &​ Is > 40:​
​ = 14, Optional​CountOfSymbols = [f2].Value​
​: так чтоль?​
​ Worksheets("Лист1").Range("A" & Y).Value​Если в столбце "B"​
​примерно такой вид​
​протяните эту формулу​Весы​
​ строчные - 2шт.​ теперь концы найти.​
​ основу это C++​ //int main(){ string​
​: О. А я​
​ "X", "Z", "A",​
​ 10))) - 1)​ s(z) & s(z)​ i = 40:​ z As Integer​
​SymNum = [f3].Value​SkyPro​ + Chr(Int(26 *​ появляется "1" то​
​ :​ вправо на кол-во​: набей в 8​
​ Они не должны​DevAlone​ int main(){ SetConsoleCP​
​ Gen(int len) std::ofstream​ не видел это​ "E", "I", "O",​
​Case 0​ & s(z) &​ End Select​
​ = -1)​
​If CountOfSymbols ^​: Понадобилось недавно сделать​ Rnd + 97))​ напротив в столбце​NQ4&+7Q56%7​ знаков в пароле​
​ ячейках генератором случайных​ стоять рядом и​: А надо не​ (1251); SetConsoleOutputCP (1251);​ outkey; outkey.open ("Your_key.doc",​ решение. Тупо взял​
​ "U", "Y", _​x = Array("B",​ s(z) _​rndm = Left(s(z)​' i -​ 9 < CountOfCombinations​
​ генерацию уникальных ID.​ End If Next​ "A" - пароль,​А здесь вы​Вы получите цифровой​ чисел нужные позиции,​
​ повторятся в одном​ копипастить чужой код,​ std::ofstream outkey; outkey.open​ std::ios::app void readValue(int&​ и запихнул весь​"0", "1", "2",​
​ "C", "D", "F",​& s(z) &​ & s(z) &​ целое число. Количество​ Then: MsgBox "Возможных​Ниже немного доработанное​ I Next Y​
​ в остальных случаях​
​ получите случайный набор​ пароль из N​ сделай проверку на​
​ пароле. (Пример 1:​
​ а писать самому,​
​ ("your_key.doc", std::ios::app |​
​ value) { while(!(cin​ алфавит в массив​ "3", "4", "5",​ "G", "H", "J",​
​ s(z) & s(z)​ s(z) & s(z)​ символов в комбинации.​
​ уникальных комбинаций меньше​
​ решение.​upup, очень срочно​ - пустота​ цифр и больших​ знаков​
​ совпадение и зацикли,​ +m8QyX*4 Пример 2:​ а если даже​ std::ios::out); char text​ >> value) ||​
​Solovaekx​ "6", "7", "8",​ "K", "L", "M",​
​ & s(z) &​
​ & s(z) &​ Максимум 40. Опционально.​ чем требуется": Exit​Возможности:​ нужно =( выручайте​
​Прощу помощи!​ латинс букв​что-то такого вида​ потом сцепи их​ H3+f5A*u).​
​ и копипастить, то​ [] = "1234567890qwertyuiopasdfghjklzxcvbnm";​ (cin.peek() != 'n')​: Здравствуйте!​
​ "0", _​ "N", "P", _​ s(z) & s(z)​ s(z) & s(z)​
​' z -​ Sub:​Генерация случаных неповторяющихся​
​Добавлено через 3 часа​
​Dim Y, I​
​=ЕСЛИ (СЛЧИС ()*20>9;СИМВОЛ​
​ :​

​ в единую цепь​​3 условие -​ разбираться, как он​ char *code; short​

​ ||(value> len; do​​Мне нужна ваша​»0″, «1», «2»,​»Q», «R», «S»,​ & s(z) &​ _​:)

excelworld.ru

Генератор паролей (запись в шаблон Word, Excel или Блокнот) + справка

​ имеет 3 значения​​On Error Resume​
​ комбинаций из символов​ 10 минут​
​ Randomize For Y​ (ЦЕЛОЕ (СЛЧИС ()*(90-65)+65));ЦЕЛОЕ​7375998​Шведов сергей​ Использование выборочных символов.​ работает. И ты​
​ len; short amount;​ { cout 32);​ помощь!​ «3», «4», «5»,​
​ «T», «V», «W»,​ s(z) & s,​& s(z) &​ _​ Next​ латиницы и арабских​выручайте;(​ = 1 To​ (СЛЧИС ()*9))​А эта формула​: http://excel-training.ru/generator-paroley-v-excel/​ Список составить в​ так и не​ std::cout > amount;​ int sum; std::cout​Мне нужно, чтобы​ «6», «7», «8»,​ «X», «Z», «A»,​ i)​ s(z) & s(z)​-1 в комбинации​Do​ цифр (опционально).​аналитика​

​ 10 Worksheets(«Лист1»).Range(«A» &​​W87N3DL​ позволит выдавать в​

​на базе этого​​ ручную. Исключение например​ сказал, в чём​ std::cout > len;​ >sum; readValue(sum); code​ пароли которые я​ «0»)​ «E», «I», «O»,​End Function​ & s(z) &​ присутствуют цифры и​RandomCombination = rndm(CountOfSymbols,​Максимальное кол-во 40​: вот так?​ Y).Value = «»​mraz​ случайном порядке большие​=ЦЕЛОЕ (СЛЧИС ()*100)&СИМВОЛ​ таких » №​ ошибка.​ code = new​ = new char​ генерирую, записывались в​t = x((Int(1​ «U», «Y»)​Function s$(Optional z​ s(z) & s(z)​

​ буквы латиницы _​​ SymNum)​ символов (есть возможность​mraz​ For I =​: При нажатие на​ латинские буквы​ (СЛУЧМЕЖДУ (33;126))&СИМВОЛ (СЛУЧМЕЖДУ​ ; : ?​Solovaekx​ char [len]; for​

​ [len]; for (int​​ шаблон Word, Excel​ + (Rnd() *​t = x((Int(1​ As Integer =​

CyberForum.ru

Нужно создать генератор паролей. Желательно в EXEL.

​ & s(z) &​1 в комбинации​

​cl.Add RandomCombination, RandomCombination​ добавить).​: эмм, не совсем,​ 0 To 6​ кнопку генерируются пароли​=СИМВОЛ (ЦЕЛОЕ (СЛЧИС​ (33;126))&СИМВОЛ (СЛУЧМЕЖДУ (33;126))&ЦЕЛОЕ​ l | ​: А что я​ (int i(0); i!=amount;​ i(0); i!=amount; i++){​ и Блокнот (по​

​ 46))) — 1)​ + (Rnd() *​ -1)​ s(z) _​ присутствуют только цифры​Loop While cl.Count​Может кому пригодится.​ при нажатие на​

​ If I =​​ в столбце «A»​ ()*(90-65)+65))​
​ (СЛЧИС ()*100)​ ][{}/>​ копирую?, лол, я​

​ i++){ for (int​​ for (int i(0);​ выбору).​

​End Select​​ 26))) — 1)​Dim x, t$​& s(z) &​ _​ <> CountOfCombinations​Код​ кнопку должно выглядить​

​ 1 Or I​​ в ячейках «от​
​LRFAPEQ​
​Успехов!​Abram pupkin​ попросил, мне накинули​ i(0); i!=len; i++){​
​ i!=len; i++){ code[i]​

​В шаблоне должно​

Для создания большого количества цифровых, буквенных либо смешанных значений, таких, например, как логины и пароли существует несколько подходов, отличающихся друг от друга удобством, простотой использования и способностью влиять на конечный результат.

Онлайн-сервисы для генерации паролей

Существует множество сервисов, которые позволяют формировать безопасные, надежные пароли в режиме онлайн. Одни позволяют сгенерировать один пароль, другие генерируют сразу по десять, третьи позволяют пользователю задавать количество создаваемых паролей. Как правило, все сервисы дают возможность выбора длины пароля и групп символов из которых этот пароль будет состоять. Многие сервисы позволяют разделять прописные и строчные буквы, русские и латинские, а также подставлять в пароль специальные знаки и исключать повторяющиеся символы.

Используя стандартные функции Excel, такие, как СЛЧИС, СЛУЧМЕЖДУ, СИМВОЛ, ЦЕЛОЕ и другие, можно создать функции для генерации паролей разной степени сложности. В сети встречаются различные способы реализации решения этой задачи. Для создания пароля из 6 символов, состоящего из латинских букв, цифр и знаков можно использовать, например, формулу:

=СЦЕПИТЬ(СИМВОЛ(СЛУЧМЕЖДУ(33;126)); СИМВОЛ(СЛУЧМЕЖДУ(33;126)); СИМВОЛ(СЛУЧМЕЖДУ(33;126)); СИМВОЛ(СЛУЧМЕЖДУ(33;126)); СИМВОЛ(СЛУЧМЕЖДУ(33;126)); СИМВОЛ(СЛУЧМЕЖДУ(33;126)))

Функция VBA для генерации простых паролей

Function GetPassword(lenght As Integer) As String
    Dim i As Integer
    Dim simbol As String
    Dim password As String
    Randomize
        For i = 1 To lenght
            simbol = Chr(Int((126 - 33 + 1) * Rnd + 33))
            password = password & simbol
        Next
    GetPassword = password
End Function

Генератор паролей заданной сложности

Надстройка для Excel – это программа, написанная на встроенном в приложения Office языке программирования VBA. Надстройка устанавливается в Excel, расширяет его возможности и позволяет генерировать любое количество паролей, логинов, кодов и любых других буквенно-цифровых значений заданной длины и любой сложности.

генератор паролей разной сложности и длины

CompleteSolutionнадстройка для генерации паролей разной сложности

Надстройка дает возможность быстро заполнить ячейки выделенного диапазона случайными значениями, гибко настроить сложность этих значений, установить нужную длину и выбрать группы символов, из которых значения будут состоять (цифры, специальные символы, строчные буквы латиницы, строчные буквы кириллицы, заглавные буквы латиницы и заглавные буквы кириллицы). Количество символов ограничено максимально возможной длиной значения ячейки, количество значений соответствует количеству ячеек выделенного диапазона.

Видео по работе с надстройкой

I need to create a password generator with VBA Excel with custom complexity of the passwords, I found this code that works fine, the problem is that when I close the XLS file and open again the macro generate the same passwords so is not a full random generator:

Sub Password_Click()
'
' Bruno Campanini 14-02-2007 Excel 2007
' Statistica.xls Sheet: Sheet10 Button: Password
'
' Compone NumPSW Password formate da:
' NumAlpha caratteri alfabetici
' NumNonAlpha caratteri non-alfabetici
' NumNum caratteri numerici
' definiti random.
'
Dim AlphaChar(1 To 26) As String, NumChar(1 To 10) As String
Dim NonAlphaChar(1 To 30) As String
Dim i As Integer, j As Integer, NumPSW As Integer
Dim NumAlpha As Integer, NumNum As Integer, NumNonAlpha As Integer
Dim PSW As String, PSWRandom As String, PSWColl As Collection
Dim R As Integer, RR As Integer, RRR As Integer, NumMaiuscole As Integer
Dim FinalRandom As Boolean, TargetRange As Range

' 26 caratteri Alpha (a - z)
For i = 97 To 122
AlphaChar(i - 96) = Chr(i)
Next

' 10 caratteri numerici (0 - 9)
For i = 1 To 10
NumChar(i) = i - 1
Next

' 30 caratteri non-Alpha
NonAlphaChar(1) = "": NonAlphaChar(2) = "|": NonAlphaChar(3) = "!"
NonAlphaChar(4) = Chr(34): NonAlphaChar(5) = "%": NonAlphaChar(6) = "&"
NonAlphaChar(7) = "/": NonAlphaChar(8) = "(": NonAlphaChar(9) = ")"
NonAlphaChar(10) = "=": NonAlphaChar(11) = "?": NonAlphaChar(12) = "'"
NonAlphaChar(13) = "^": NonAlphaChar(14) = "_": NonAlphaChar(15) = "-"
NonAlphaChar(16) = ".": NonAlphaChar(17) = ":": NonAlphaChar(18) = ","
NonAlphaChar(19) = ";": NonAlphaChar(20) = "@": NonAlphaChar(21) = "#"
NonAlphaChar(22) = "*": NonAlphaChar(23) = "+": NonAlphaChar(24) = "["
NonAlphaChar(25) = "]": NonAlphaChar(26) = "[": NonAlphaChar(27) = "]"
NonAlphaChar(28) = "$": NonAlphaChar(29) = "<": NonAlphaChar(30) = ">"

' Definizioni ------------------------------------------
NumAlpha = 6 ' Numero caratteri alfabetici
NumNonAlpha = 1 ' Numero caratteri non alfabetici
NumNum = 4 ' Numero caratteri numerici
NumMaiuscole = 3 ' Numero maiuscole
FinalRandom = True ' Rimescolamento random finale
'
NumPSW = 10 ' Numero password da generare
Set TargetRange = [Sheet1!A1] ' Destinazione
' ------------------------------------------------------

If NumMaiuscole > NumAlpha Then
MsgBox "Non possono esservi " & NumMaiuscole & _
" maiuscole su " & NumAlpha & " caratteri!"
Exit Sub
End If

Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
For j = 1 To NumPSW
PSW = ""

' Definisce il gruppo AlphaChar
R = NumAlpha
RR = UBound(AlphaChar)
GoSub LoadCollection
For i = 1 To NumAlpha
PSW = PSW & AlphaChar(PSWColl(i))
Next

' Definisce le Maiuscole
R = NumMaiuscole
RR = R
GoSub LoadCollection
For i = 1 To NumMaiuscole
Mid(PSW, PSWColl(i), 1) = UCase(Mid(PSW, PSWColl(i), 1))
Next

' Definisce il gruppo NonAlphaChar
R = NumNonAlpha
RR = UBound(NonAlphaChar)
GoSub LoadCollection
For i = 1 To NumNonAlpha
PSW = PSW & NonAlphaChar(PSWColl(i))
Next

' Definisce il gruppo NumChar
R = NumNum
RR = UBound(NumChar)
GoSub LoadCollection
For i = 1 To NumNum
PSW = PSW & NumChar(PSWColl(i))
Next

If FinalRandom Then
' Rimescola Random i tre gruppi
R = NumAlpha + NumNonAlpha + NumNum
RR = R
GoSub LoadCollection
PSWRandom = ""
For i = 1 To NumAlpha + NumNonAlpha + NumNum
PSWRandom = PSWRandom & Mid(PSW, PSWColl(i), 1)
Next
PSW = PSWRandom
End If

TargetRange(j) = "'" & PSW
Next

Exit_Sub:
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Exit Sub

' Carica PSWColl con valori unici
LoadCollection:
Set PSWColl = New Collection
Do Until PSWColl.Count = R
RRR = Int((RR) * Rnd + 1)
On Error Resume Next
PSWColl.Add RRR, CStr(RRR)
On Error GoTo 0
Loop
Return

End Sub

Thanks

Is possible to modify the code in order to generate random password every time I open the files ?

Thanks

Понравилась статья? Поделить с друзьями:
  • Генератор неповторяющихся случайных чисел excel
  • Генератор макросов для excel
  • Генератор кодов для word
  • Генератор ключей для word 2016
  • Генератор ключей для microsoft word 2019