help with a loop

dantheman9

Board Regular
Joined
Feb 5, 2011
Messages
175
Hi,
how could I loop through the following:
Code:
Userform1.Name1.Text = Range("A12")
Userform1.class1.Text = Range("A14")
Userform1.Name2.Text = Range("A17")
Userform1.class2.Text = Range("A19")
Userform1.Name3.Text = Range("A22")
Userform1.class3.Text = Range("A24")
Userform1.name4.Text = Range("A27")
Userform1.class4.Text = Range("A29")
Userform1.Name5.Text = Range("A32")
Userform1.class5.Text = Range("A34")
Userform1.Name6.Text = Range("A37")
Userform1.class6.Text = Range("A39")
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Probably something like:

Code:
  Dim i As Long
  For i = 1 To 6
    UserForm1("Name" & i).Text = Range("A" & 12 + (i - 1) * 5).Value
    UserForm1("class" & i).Text = Range("A" & 17 + (i - 1) * 5).Value
  Next i
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,911
Members
452,949
Latest member
beartooth91

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