DaveMcPhet
New Member
- Joined
- Jul 29, 2020
- Messages
- 7
- Office Version
- 365
- Platform
- Windows
Hi all,
I am working on a sheet I created for work. What I am trying to do is use a loop to put the data from a user form onto a sheet. The number of textboxes varies on the number of nodes on a line I have. i could have from 1 to 8 text boxes. each named tbmux1, tbmux2, and so on. What i need is to use the counter to determine which textbox i am pulling the info from. here is what i have been trying and cannot seem to get it to work. as you can tell by what I have commented out I have been trying a lot of different things. the ones that are commented out, i will be able to get one I can figure out how to do this. I am still learning so excuse my work if it looks a little rudimentary
.
I am working on a sheet I created for work. What I am trying to do is use a loop to put the data from a user form onto a sheet. The number of textboxes varies on the number of nodes on a line I have. i could have from 1 to 8 text boxes. each named tbmux1, tbmux2, and so on. What i need is to use the counter to determine which textbox i am pulling the info from. here is what i have been trying and cannot seem to get it to work. as you can tell by what I have commented out I have been trying a lot of different things. the ones that are commented out, i will be able to get one I can figure out how to do this. I am still learning so excuse my work if it looks a little rudimentary
VBA Code:
For counter = 1 To muxqty
nextline = counter + 1
boxno = counter
Worksheets("results").Range("STOP_MUX1").Offset(counter, 0) = tbmux & boxno [B]<this is what i need to say tbmux1, tbmux2, etc>[/B]
Worksheets("results").Range("START_MUX1").Offset(nextline, 0) = tbmux & boxno
'Worksheets("results").Range("INCHES1").Offset(counter, 0) = mux(counter)mark
'Worksheets("results").Range("mtype1").Offset(counter, 0) = cbtype(counter)
'Worksheets("results").Range("FEET1").Offset(counter, 0) = Worksheets("results").Range("INCHES1").Offset(counter, 0) * _
Worksheets("results").Range("G6").value
Next counter
.