Eileen's Free Random Data Generator for Excel

User avatar
HansV
Administrator
Posts: 78417
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Simple Random Data Generator (Version 1)

Post by HansV »

the 3rd argument to Mid is the length, not the end position. So you should use

Code: Select all

    Me.txtLocation = Mid(Me.txtLocation, InStr(1, Me.txtLocation, "$"), InStr(1, Me.txtLocation, ":") - InStr(1, Me.txtLocation, "$"))
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Simple Random Data Generator (Version 2)

Post by Rudi »

:bingo: - Oops...Silly Me!!
TX

It is working well now!

Here is the latest add-in (version 2) with everything running well now...

1. Download and unzip the add-in to your computer
2. Use the Add-Ins dialog in Excel to browse and activate the add-in
3. Once the add-in is installed, add a button to Excel's quick access toolbar (QAT) to run the macro called: Eileens_RandomDataGenerator.

Running the macro will pop up the data form to prompt for input on how and where you want to create the random data.
Eileens Random Data Generator (V2).zip
You do not have the required permissions to view the files attached to this post.
Last edited by Rudi on 10 Mar 2014, 10:57, edited 2 times in total.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Simple Random Data Generator (Version 1)

Post by BenCasey »

Ben:
The code is under the Create Data button of the UserForm
If you open the Workbook, press ALT+F11
Double click on the folder called Forms in the VBA Projects Window (top left of VBA Editor)
Double click on frmSampleData (the userform)
Double click on the Create Data command button
It will open a Private Module with the code (which runs when the user clicks the button at run time)
Hi Rudi,
1. the form loads ok and works ok from the button.
2. Pressing Alt-F11 will open the Editor (blank-all greyed out-no code)
3. There is no folder called VBA Projects or anything of similar name.
4. None of the available buttons or drop downs on the top menu bar have any relevant links either.
I am guessing that as I cannot see it that it must be something to do with my Excel Options settings.
Any thoughts?
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Simple Random Data Generator (Version 2)

Post by BenCasey »

Rudi wrote::bingo: - Oops...Silly Me!!
TX

It is working well now!

Here is the latest add-in (version 2) with everything running well now...
Eileens Random Data Generator (V2).zip
Rudi, this unzipped to
Eileens Random Data Generator (V2).xlam

Is this correct, nothing shows when it opens.
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

User avatar
HansV
Administrator
Posts: 78417
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Simple Random Data Generator (Version 1)

Post by HansV »

If you don't see the Project Explorer (screenshot below) in the Visual Basic Editor, select View > Project Explorer or press Ctrl+R.
S262.jpg
A .xlam file is an Excel add-in. To activate it:
- Select File > Options.
- Click Add-Ins.
- Click Go... next to Excel Add-Ins.
- Click Browse...
- Locate and select Eileens Random Data Generator (V2).xlam
- Click OK, then OK again.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Simple Random Data Generator (Version 2)

Post by Rudi »

BenCasey wrote: Rudi, this unzipped to
Eileens Random Data Generator (V2).xlam

Is this correct, nothing shows when it opens.
Sorry Ben,

I forgot to add the instructions...

1. Download and unzip the add-in to your computer
2. Use the Add-Ins dialog in Excel to browse and activate the add-in
3. Once the add-in is installed, add a button to Excel's quick access toolbar (QAT) to run the macro called: Eileens_RandomDataGenerator.

Running the macro will pop up the data form to prompt for input on how and where you want to create the random data.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Simple Random Data Generator (Version 1)

Post by BenCasey »

Hans: Thanks for the instructions.

Rudi: I think this is a very useful add-in. From the data generated it will be easy to export it as a csv and the use that to import to Access. Great stuff. Thank you.
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Simple Random Data Generator (Version 1)

Post by Rudi »

TX Ben :smile:

I have often scanned the web for random data generators and there are some excellent paid for add-in's, but often they offer far more than I need in general. One or two free ones are around, but I cannot modify the code to customize for my needs, or they are just corrupt or for older versions. So I just put my head down and thought to create a simple one for my needs.

Strangely, the Northwind sample data I use in this add-in is actually from the Northwind Sample Database that comes with Access. So, although you can use the data and upload into Access, the app should have similar data in its sample database template.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Simple Random Data Generator (Version 1)

Post by BenCasey »

Strangely, the Northwind sample data I use in this add-in is actually from the Northwind Sample Database that comes with Access. So, although you can use the data and upload into Access, the app should have similar data in its sample database template.
I have never used Northwind.
Thanks for the tip.
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Eileens Random Data Generator for Excel (Version 2.2)

Post by Rudi »

Made a few minor changes again :grin: (As they say, an app is NEVER finished...)

Here is the latest version of Eileen's Random Data Generator...(version 2.2)

1. Download and unzip the add-in to your computer
2. Use the Add-Ins dialog in Excel to browse for and activate the add-in
3. Once the add-in is activated, add a button to Excel's quick access toolbar (QAT) to run the macro called: Eileens_RandomDataGenerator.

Running the macro will pop up the data form to prompt for input on how and where you want to create the random data.

Note: If you have any ideas for additions/changes/improvements...please feel free to mention. It is a work in progress.
Eileens Random Data Generator (V2.2).xlam.zip
Random Data Generator.jpg
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Eileen's Free Random Data Generator (v.3) for Excel

Post by Rudi »

Hi all,

Here is the final version of the Random Data Generator for Excel (version 3), unless there is further bright ideas for improving it :grin:
Eileens Random Data Generator (V3).zip
To install and use, follow these steps:
1. Download and unzip the add-in to your computer
2. Use the Add-Ins dialog in Excel to browse for and activate the add-in
3. Once the add-in is activated, add a button to Excel's quick access toolbar (QAT) to run the macro called: Eileens_RandomDataGenerator.

Running the macro will pop up the data form to prompt for input on how and where you want to create the random data.

Preview Image:
2014-03-11_16h24_34.jpg
[/size]
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Eileen's Free Random Data Generator for Excel

Post by Rudi »

Another useful update to this add-in:

A UserForm object has a property named StartUpPosition. By default, this property is set to 1 (CenterOwner), which means that it should appear in the center of Excel's window. This works fine, unless you have a dual-monitor system. In such a case, the UserForm is not centered in the Excel window but tends to always display on the left side of the secondary monitor, even if Excel is maximized on the primary monitor.

To force this UserForm to be centered in Excel's window, use the code below.
See the attached screenshot to illustrate where you change the code.

1. If you have the add-in active in your add-in list, you can open the VBA editor (press ALT+F11).
2. Open the VBA Project (Eileens Random Data Generator (V3).xlam)
3. Double click on the Modules folder and also on Module1
4. Replace the entire macro on the right side with the code below. (See image at the bottom of this post.)

Code: Select all

Sub Eileens_RandomDataGenerator()
    With frmSampleData
      .StartUpPosition = 0
      .Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
      .Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
      .Show
    End With
End Sub
UpdateCode.jpg
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Eileen's Free Random Data Generator 3.1 for Excel

Post by Rudi »

Some of my colleagues have shown interest in this add-in and requested some additions:
- Dialog to open center screen in Excel on dual monitor
- A balanced mix of content button
- Formatting on column headings
- The ability to transpose the data (if no headings selected)

Here is the latest updated add-in:
Eileens Random Data Generator 3.1.xlam.zip
Instructions to install can be found in the posts above this one....
You do not have the required permissions to view the files attached to this post.
Last edited by HansV on 19 Mar 2014, 10:45, edited 6 times in total.
Reason: to update the attachment
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78417
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Eileen's Free Random Data Generator for Excel

Post by HansV »

Thanks. This is a version without data?
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Eileen's Free Random Data Generator for Excel

Post by Rudi »

HansV wrote:Thanks. This is a version without data?
Oops... LOL...that was the test version. Emailing for you to upload TX.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78417
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Eileen's Free Random Data Generator for Excel

Post by HansV »

I have added in the add-in... to your post :smile:
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Eileen's Free Random Data Generator for Excel

Post by Rudi »

I have made some recent updates to the add-in called: Eileen's Random Data Generator (to generate a random selection of data in Excel).
I will get Hans to add the "add-in" into this post (since it is 500KB and too large for me to add as an attachment)
When the add-in appears (TX Hans)...feel free to download it and use it to generate sample data for testing purposes; (compliments of Eileen's Lounge Software :grin: )

To use:
1. Download and unzip the add-in to your computer
2. Use the Add-Ins dialog in Excel to browse and activate the add-in
3. Once the add-in is installed, add a button to Excel's quick access toolbar (QAT) to run the macro called: Eileens_RandomDataGenerator.

Running the macro will pop up the data form to prompt for input on how and where you want to create the random data.

Here is the add-in: Eileen's Random Data Generator v4.0
Eileens Random Data Generator 4.zip
Add-in image with updates indicated)
RDG.jpg
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78417
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Eileen's Free Random Data Generator for Excel

Post by HansV »

The new version has been attached to the previous post.
Best wishes,
Hans

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Eileen's Free Random Data Generator for Excel

Post by LisaGreen »

ooh I like this!!! For some reason or other this is the first time I've looked at it! My loss.

Good work you men!!

Hugs
Lisa