austinpcherry
New Member
- Joined
- Feb 26, 2014
- Messages
- 36
I am setting up a Form in VBA. I have all of my variables and types set properly. The purpose is for units with unique numbers and varying counts.
So item number 100 may be made up of 30 pieces.
I can have multiple unique items per order.
My form gets a total number of items, then asks for each item number, then the count of pieces on each item.
I am using a loop to copy and paste cells for each item onto my printable form. While in my loop I want to call my variables and fill-in the data associated with the variables.
What I want to do is to insert a line before the "Next j" that puts the information stored in variables "item1" - "item4" where they exist using the j variable to specify the item#. So itemj, so that it uses the appropriate item# based on which time it copied the reference cells.
How can I do that? Have I coded myself into a corner? Have I set the whole thing up incorrectly?
So item number 100 may be made up of 30 pieces.
I can have multiple unique items per order.
My form gets a total number of items, then asks for each item number, then the count of pieces on each item.
I am using a loop to copy and paste cells for each item onto my printable form. While in my loop I want to call my variables and fill-in the data associated with the variables.
Code:
For j = 1 to (total number of items)
m=11+j *for spacing purposes
Worksheets(reference").range("a12:g12").copy Worksheets(ws.name).range("a1").offset(m,0)
Range(cells(,.5), cells(m,6)).mergecells =true
Next j
What I want to do is to insert a line before the "Next j" that puts the information stored in variables "item1" - "item4" where they exist using the j variable to specify the item#. So itemj, so that it uses the appropriate item# based on which time it copied the reference cells.
How can I do that? Have I coded myself into a corner? Have I set the whole thing up incorrectly?