Hi there. I have no prior experience of VBA, and have searched around the forum for my solution, but no luck. I'm pretty sure what I'm after is simple enough for the VBA folk.
I have a spreadsheet with lists of personnel data. Column A is the column with the names of the personnel. Typically there are up to seventy people (rows), but I want to future proof this to max of 200.
I want to run a macro and have it create a worksheet for each person in Column A and rename the worksheets with the name of the person. I've managed to cobble together a basic macro which allows me to create one worksheet based on a single cell, but I have no idea how to create the loop effect. I'm very familiar with Excel formulae, and have created a COUNTA on the list of rows to give a running total of 'live' rows, if that makes the loop easier to function.
Here's my basic macro so far:
So that code creates a new worksheet and names it with the value in cell A1.
I intend to have the master template to have a couple of sheets prior to any population and running of macros, so not sure if those named sheets should be in the macro, or if their numerical position (Sheets(1)) is better. Ideally, I'd like to use a 'deletable' worksheet as the source of the data for the macro (a copy of the master sheet), and have the macro delete the copysheet as the last step, to prevent accidental re-running. After populated, the spreadsheet will be saved as something else to help prevent this too.
All other copy/paste data stuff within the VBA should be easy enough with the recorder.
Complete novice. Hopefully too much info is better than not enough.
Bookmarks