Macro to add new row

delexcel

Board Regular
Joined
Feb 22, 2007
Messages
185
Hi there,

I have built a rostering tool, and am looking to add the functionality of a macro that helps to add new employees.

I propose the following but am open to any solution - especially if it can be accomplished in a simpler way.

I have a sheet ('master') that is the master list of employees, all of which are in column A starting in row 3.

There are seven other sheets for each day of the week - 'Mon', Tue', 'Wed' etc.

The names of employees in the days of the week sheets start in B3.

The challenge:

I would like to be able to call a macro using a 'new employee' button in the 'master' sheet, which then presents the user with a pop up that asks them for their first and last name (in separate text boxes).

The user would then be able to click a 'add employee' button within the userform, and then the new employee is added to each of the days of the week sheets as well as the master sheet.

Note 1: employees are in alphabetical order so the macro would need to insert the new row based on the surname entered into the textbox.
Note 2: The day of week sheets are locked and password protected, so when adding a new employee the sheet would need to be unlocked, name added, then locked again.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
When Ive done this, I just add the new entry to the bottom of the data table and have the macro re-alphabetize the table once the data has been entered. Macros can unlock and re-lock the sheets as needed.
 
Upvote 0
When Ive done this, I just add the new entry to the bottom of the data table and have the macro re-alphabetize the table once the data has been entered. Macros can unlock and re-lock the sheets as needed.

Problem is that I am looking to have the new employee not just added to the master sheet ('data table'), but to each of the weekday sheets.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,276
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top