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

WinDirStat

Use WinDirStat to Clean Up Hard Drive

Today's hard drives are large and can store tons of files, pictures, videos, etc. But, even with all this space there still may be a time when you need to clean up because the hard drive is filling up. There are the obvious places to check like the Recycle Bin or use the Disk CleanUp tool. But, … [Read More...]

Six Elements to Look out for to Secure Your Containerized Cloud-Based App Workloads

Cloud security remains a major concern for SMEs around the world. Some experts have trivialized the issues. A study from Gartner states that 95% of cloud security issues will be the fault of the customers through 2022. However, some of the risks on the enterprise side are significant enough to … [Read More...]

Why Did No One Tell Drivers About This New Rule?

Do not pay your next car insurance bill until you read this… May - (2015): Your Current car insurance company doesn't want you to know this but as someone who loves to save money and someone who loves to share what they learn, I want you to know. The simple truth is car insurance rates are … [Read More...]

Importance of Inbound Marketing in the Digital Age

A couple of months ago, Zacks reported that Hubspot was starting to make some major changes to its inbound marketing strategy. They talk a lot about … [Read More...]

Damage Control Strategies for Resolving Online PR Crises

Last July, Astrologer faced a major crisis after its CEO went viral at a ColdPlay concert when having an affair. This was just one of the many times a … [Read More...]

AI is Not Killing Computer Jobs Like Doomers Projected

There is no denying the reality that AI technology has played a massive role in disrupting our lives. A growing number of people claim that AI … [Read More...]

Everything You Need to Know About Sourcing Circuit Boards From U.S. Suppliers

In This Article This article includes: Why Source PCBs From the United States?How to Get a Quote From a U.S.-Based PCB ManufacturerThe Top U.S. … [Read More...]

Top Taplio Alternatives in 2025 : Why MagicPost Leads for LinkedIn Posting ?

LinkedIn has become a strong platform for professionals, creators, and businesses to establish authority, grow networks, and elicit engagement. Simple … [Read More...]

Shocking Cybercrime Statistics for 2025

People all over the world are becoming more concerned about cybercrime than ever. We have recently collected some statistics on this topic and … [Read More...]

Guides

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

Recent Posts

USB 2.0 Intefaces

While USB was originally designed to replace legacy serial and parallel connections, notwithstanding the claims that they were complementary … [Read More...]

Can Alexa Help Your Business To Become A Top Player On The Web?

Alexa Internet Inc. was founded in 1996 by Brewster Kahle and Bruce  Gilliat as an independent company and acquired by Amazon.com in 1999. Now simply … [Read More...]

Bitdefender Total Security Review

PROS: All products are combined into one for PC security,plus systems tools for PC performance. CONS: Since the program scans your computer … [Read More...]

[footer_backtotop]

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