Macro to Generate Rows/Item Numbers based on User Input

JaredMcCullough

Well-known Member
Joined
Aug 1, 2011
Messages
516
I was looking to utilize a Macro to create a portion of a template for me. I was hoping to maybe use a Userform instead of an Inputbox style as it will provide more friendly for the user creating the template. My goal was to use Textbox inputs in a userform to generate a header row then generate a number of rows after. So an example would be "Textbox1" would generate a row after row 15 (thus row 16) and populate column A of that Row with the "Name" typed into the textbox. Then on the Userform right beside "Textbox1" will be "Textbox2" which promotes for "Number of Questions". The user inputs a number in this box (ex. 6) and when the hit the command button for the userform it do the following: Generate a header row after row 15 and put the name in cell A of that row, then generate 6 rows below that as that is what the user input.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,215,563
Messages
6,125,572
Members
449,237
Latest member
Chase S

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