question

AinaMike-7566 avatar image
0 Votes"
AinaMike-7566 asked DougRobbins-6392 answered

Excel - User Fills Out Form, Based on Number in X-Cell the data is copied that same number of times on a new sheet

Good Day,

I want the user to fill out a "form" in Excel where there is a cell labeled "Number of Strands" and when the user hits the "Submit" button of the form, the data is copied to another sheet named "OSP" and the inputted data is copied the number of times equal to that of "Number of Strands" cell. So if I fill out the form and have Number of Strands = 5, I want that data copied into 5 rows at the bottom of "OSP" sheet. I have attached a screenshot of the form and the code I have so far is below. I have been able to get the form to copy the data from the form to the "OSP" sheet, but cannot figure out how to copy that data x number of times.

I was originally trying to have so if the user had a start and end strand number, say 1-5, it would count the integers in that range (5), insert that number of rows with the inputted data, but also Number the "Strand Number" column of the newly made 5 rows to show descending as 1, 2, 3, 4, 5. If the user were to input a range of 440-460, when submitted, 21 rows would be added and the "Strand Number" column would display 440, 441, 442, 443, etc, but I found this to be too complicated.

I tried multiple code options but can't find one that truly suits my need. Any help copying the data x number of times based on this cell's value would be greatly appreciated.

I have attached pic of the form I'm working with.


137054-form.png


office-vba-devoffice-scripts-excel-dev
form.png (29.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DougRobbins-6392 avatar image
0 Votes"
DougRobbins-6392 answered

@AinaMike-7566

How is the data to be arrange on the OSP sheet?

What is it that is to be inserted into that sheet? If it is the "This, is, a, test, please, etc." what are the cell references of those cells?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.