pctechguide.com

  • Home
  • Guides
  • Tutorials
  • Articles
  • Reviews
  • Glossary
  • Contact

VBA Macro that Randomly Shows a Boy’s Name in Column A

Are you trying to come up with a boy’s name at random? There may be a number of reasons that you want to do this. you may be writing a book for example, and don’t want to keep thinking about the same names for all of your characters.

The good news is that there is a way to do this with VBA. We created the following macro that randomly chooses a boy’s name from a list of the 300 most common boy’s names in the United States.

You will need to copy the code below in the VBA Editor and click the “Run” button. We have some other primers on how to do that on this site.

Here is the macro.

Sub RandomName()
Dim namesList As Variant
Dim lastRow As Long
Dim randomIndex As Integer

' Define the list of names
namesList = Split("Liam Noah Oliver James Elijah William Henry Lucas Benjamin Theodore Mateo Levi Sebastian Daniel Jack Michael Alexander Owen Asher Samuel Ethan Leo Jackson Mason Ezra John Hudson Luca Aiden Joseph David Jacob Logan Luke Julian Gabriel Grayson Wyatt Matthew Maverick Dylan Isaac Elias Anthony Thomas Jayden Carter Santiago Ezekiel Charles Josiah Caleb Cooper Lincoln Miles Christopher Nathan Isaiah Kai Joshua Andrew Angel Adrian Cameron Nolan Waylon Jaxon Roman Eli Wesley Aaron Ian Christian Ryan Leonardo Brooks Axel Walker Jonathan Easton Everett Weston Bennett Robert Jameson Landon Silas Jose Beau Micah Colton Jordan Jeremiah Parker Greyson Rowan Adam Nicholas Theo Xavier Hunter Dominic Jace Gael River Thiago Kayden Damian August Carson Austin Myles Amir Declan Emmett Ryder Luka Connor Jaxson Milo Enzo Giovanni Vincent Diego Luis Archer Harrison Kingston Atlas Jasper Sawyer Legend Lorenzo Evan Jonah Chase Bryson Adriel Nathaniel Arthur Juan George Cole Zion Jason Ashton Carlos Calvin Brayden Elliot Rhett Emiliano Ace Jayce Graham Max Braxton Leon Ivan Hayden Jude Malachi Dean Tyler Jesus Zachary Kaiden Elliott Arlo Emmanuel Ayden Bentley Maxwell Amari Ryker Finn Antonio Charlie Maddox Justin Judah Kevin Dawson Matteo Miguel Zayden Camden Messiah Alan Alex Nicolas Felix Alejandro Jesse Beckett Matias Tucker Emilio Xander Knox Oscar Beckham Timothy Abraham Andres Gavin Brody Barrett Hayes Jett Brandon Joel Victor Peter Abel Edward Karter Patrick Richard Grant Avery King Caden Adonis Riley Tristan Kyrie Blake Eric Griffin Malakai Rafael Israel Tate Lukas Nico Marcus Stetson Javier Colt Omar Simon Kash Remington Jeremy Louis Mark Lennox Callum Kairo Nash Kyler Dallas Crew Preston Paxton Steven Zane Kaleb Lane Phoenix Paul Cash Kenneth Bryce Ronan Kaden Maximiliano Walter Maximus Emerson Hendrix Jax Atticus Zayn Tobias Cohen Aziel Kayson Rory Brady Finley Holden Jorge Malcolm Clayton Niko Francisco Josue Brian Bryan Cade Colin Andre Cayden Aidan Muhammad Derek Ali Elian Bodhi Cody Jensen Damien Martin", " ")

' Find the last row with data in column A
lastRow = Cells(Rows.Count, 1).End(xlUp).Row

' Generate a random index within the range of the names list
randomIndex = Int((UBound(namesList) - LBound(namesList) + 1) * Rnd + LBound(namesList))

' Display the randomly selected name in column A
Cells(lastRow + 1, 1).Value = namesList(randomIndex)

End Sub

Filed Under: Articles

Latest Articles

Intel Sonomo improves wireless integration in mobile devices

Together with the explosive worldwide growth in WLAN hotspots, the unveiling of Intel's second-generation mobile technology platform in January 2005 is expected to lead to the completion of the notebook PC's transition from a portable to a … [Read More...]

Graphics Card Installation – WinXP

As mentioned at the start of this tutorial graphics card manufacturers nowadays supply downloadable self-extracting archives that simply need to be double-clicked to install the latest driver software, often along with other utilities. It follows that in the era of Windows XP, this will be … [Read More...]

10 tips to avoid ransomware

Cybersecurity threats are costly nightmares. According to the FBI's 2020 Internet Crime Report, ransomware attacks in the United States alone cost U.S. organizations more than $29.1 million last year. The U.S. government considers that paying the ransom is entering a vicious cycle that will motivate … [Read More...]

Gaming Laptop Security Guide: Protecting Your High-End Hardware Investment in 2025

Since Jacob took over PC Tech Guide, we’ve looked at how tech intersects with personal well-being and digital safety. Gaming laptops are now … [Read More...]

20 Cool Creative Commons Photographs About the Future of AI

AI technology is starting to have a huge impact on our lives. The market value for AI is estimated to have been worth $279.22 billion in 2024 and it … [Read More...]

13 Impressive Stats on the Future of AI

AI technology is starting to become much more important in our everyday lives. Many businesses are using it as well. While he has created a lot of … [Read More...]

Graphic Designers on Reddit Share their Views of AI

There are clearly a lot of positive things about AI. However, it is not a good thing for everyone. One of the things that many people are worried … [Read More...]

Redditors Talk About the Impact of AI on Freelance Writers

AI technology has had a huge impact on our lives. A 2023 survey by Pew Research found that 56% of people use AI at least once a day or once a week. … [Read More...]

11 Most Popular Books on Perl Programming

Perl is not the most popular programming language. It has only one million users, compared to 12 million that use Python. However, it has a lot of … [Read More...]

Guides

  • Computer Communications
  • Mobile Computing
  • PC Components
  • PC Data Storage
  • PC Input-Output
  • PC Multimedia
  • Processors (CPUs)

Recent Posts

Top Computer Video Games in 2020

The PC gaming market is maturing, but it is also very robust. The market will be worth $30.71 billion by 2022. It is growing at a pace of 2.2% a year, … [Read More...]

3 Huge Benefits of White Label Mobile Wallets

For most, the term “Mobile Wallet” brings up images of consumer products such as Apple Pay, Paypal, or Square. Mobile wallets are revolutionizing … [Read More...]

Riser architectures for motherboards

In the late 1990s, the PC industry developed a need for a riser architecture that would contribute towards reduced overall system costs and at the … [Read More...]

[footer_backtotop]

Copyright © 2025 About | Privacy | Contact Information | Wrtie For Us | Disclaimer | Copyright License | Authors