Loop through labels on mulitpage control?


New Member
May 9, 2015
Good Morning,

I have a multipage control that will be utilizing the same label names on each page of the control (about 9 pages total). Each page however will have a different caption name for the label (i.e Label16.Caption on Page 1 will read "ABC"; the Label16.Caption on Page 2 will read "DEF" and so on. Each label caption is based on a Dim'd Range.

Without having to do the below code for each page, Is there a way to loop through the pages to fill in the caption names for each label?

 	Option Explicit

Dim LTE1C As Object, LTE2C As Object, LTE3C As Object, LTE4C As Object
Dim POWER As Object, ANTENNAS As Object, TMAS As Object, SURGE As Object, FIBER As Object, MISC As Object, NSB As Object

Private Sub UserForm_Initialize()

Set LTE1C = Worksheets("CONTROLSBOM").Range("LTE1CBOM")
Set LTE2C = Worksheets("CONTROLSBOM").Range("LTE2CBOM")
Set LTE3C = Worksheets("CONTROLSBOM").Range("LTE3CBOM")
Set LTE4C = Worksheets("CONTROLSBOM").Range("LTE4CBOM")

Label3.Caption = Date & ": " & Time
Label5.Caption = Environ("Username")


MultiPage1.Page1.Label16.Caption = LTE1C(1, 1)
MultiPage1.Page1.Label17.Caption = LTE1C(1, 6)
MultiPage1.Page1.Label18.Caption = LTE1C(1, 5)

MultiPage1.Page1.Label19.Caption = LTE1C(2, 1)
MultiPage1.Page1.Label20.Caption = LTE1C(2, 6)
MultiPage1.Page1.Label21.Caption = LTE1C(2, 5)

MultiPage1.Page1.Label22.Caption = LTE1C(3, 1)
MultiPage1.Page1.Label23.Caption = LTE1C(3, 6)
MultiPage1.Page1.Label24.Caption = LTE1C(3, 5)

MultiPage1.Page1.Label25.Caption = LTE1C(4, 1)
MultiPage1.Page1.Label26.Caption = LTE1C(4, 6)
MultiPage1.Page1.Label27.Caption = LTE1C(4, 5)

MultiPage1.Page1.Label28.Caption = LTE1C(5, 1)
MultiPage1.Page1.Label29.Caption = LTE1C(5, 6)
MultiPage1.Page1.Label30.Caption = LTE1C(5, 5)

MultiPage1.Page1.Label31.Caption = LTE1C(6, 1)
MultiPage1.Page1.Label32.Caption = LTE1C(6, 6)
MultiPage1.Page1.Label33.Caption = LTE1C(6, 5)

MultiPage1.Page1.Label34.Caption = LTE1C(7, 1)
MultiPage1.Page1.Label35.Caption = LTE1C(7, 6)
MultiPage1.Page1.Label36.Caption = LTE1C(7, 5)

MultiPage1.Page1.Label37.Caption = LTE1C(8, 1)
MultiPage1.Page1.Label38.Caption = LTE1C(8, 6)
MultiPage1.Page1.Label39.Caption = LTE1C(8, 5)

MultiPage1.Page1.Label40.Caption = LTE1C(9, 1)
MultiPage1.Page1.Label41.Caption = LTE1C(9, 6)
MultiPage1.Page1.Label42.Caption = LTE1C(9, 5)

MultiPage1.Page1.Label43.Caption = LTE1C(10, 1)
MultiPage1.Page1.Label44.Caption = LTE1C(10, 6)
MultiPage1.Page1.Label45.Caption = LTE1C(10, 5)

MultiPage1.Page1.Label46.Caption = LTE1C(11, 1)
MultiPage1.Page1.Label47.Caption = LTE1C(11, 6)
MultiPage1.Page1.Label48.Caption = LTE1C(11, 5)

MultiPage1.Page1.Label49.Caption = LTE1C(12, 1)
MultiPage1.Page1.Label50.Caption = LTE1C(12, 6)
MultiPage1.Page1.Label51.Caption = LTE1C(12, 5)

MultiPage1.Page1.Label52.Caption = LTE1C(13, 1)
MultiPage1.Page1.Label53.Caption = LTE1C(13, 6)
MultiPage1.Page1.Label54.Caption = LTE1C(13, 5)

MultiPage1.Page1.Label55.Caption = LTE1C(14, 1)
MultiPage1.Page1.Label56.Caption = LTE1C(14, 6)
MultiPage1.Page1.Label57.Caption = LTE1C(14, 5)

MultiPage1.Page1.Label58.Caption = LTE1C(15, 1)
MultiPage1.Page1.Label59.Caption = LTE1C(15, 6)
MultiPage1.Page1.Label60.Caption = LTE1C(15, 5)

End Sub

Please ask for more detail if needed. I'll be monitoring this thread through the the morning.

Thank you for the assistance.


Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).


Well-known Member
Feb 7, 2012
Office Version
  1. 2013
  1. Windows
One way, Assuming you are writing inside the UserForm code module then
For Each pg In MultiPage1.Pages
	'pg.Caption = MyPage - sample statement
	'other code here
Upvote 0

Forum statistics

Latest member
Elvin A

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