Macro to add X number of rows and enter appropriate formulas and values

mbrowning

New Member
Joined
Oct 29, 2013
Messages
11
Hi all,

I'm trying to come up with a macro and I've been struggling with it. I've uploaded an example file to Dropbox because it's pretty hard to explain without it. https://www.dropbox.com/s/l333kp1mr85tk7h/examplefile.xlsx?dl=0 (Click the ... at the top right if you want to save the file locally)

I want the user to be able to select an employee from a list in A1 and the first Monday of the week from a list in C1 then execute a macro that will insert X number of rows times 7 for each day of the week. These new rows should show up at the bottom after the last row with data. In these new rows I want column A populated with the selected employee's name, column B should be the group they are in, C should be the day of the week, starting with the date selected in C1. After X number of tasks, which is indicated in cell D1, it should go to the next day. Column D I would like to populate with the tasks listed on the group's sheet. Ideally if a new task is added, it will get picked up the next time the macro is run.
Column E is just a simple concatenate formula I need in there to do a sumifs macro I wrote.
Column F & G will be blank, there for user input.
Columns H & J-M are formulas based on the date in that row in column C.
And finally column I is just the pointing to C1 to get the first Monday of the week.
At the end of this macro I'd like all the formulas changed to values. This part seems easy enough with a copy paste special macro.
The sample file above has how I'd hope it could look prior to being changed from formulas to values in A3:M51.

If anyone could help I would greatly appreciate it! I'd like to think I'm a fast learner so if there are threads related to this that you know of I could try to work off that. I've tried searching but I came up short on that front. Thanks!!
 
Last edited:

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,215,214
Messages
6,123,665
Members
449,114
Latest member
aides

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