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?
Please ask for more detail if needed. I'll be monitoring this thread through the the morning.
Thank you for the assistance.
pt
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?
Code:
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")
Set POWER = Worksheets("CONTROLSBOM").Range("POWERANDCONVERTERS")
Label3.Caption = Date & ": " & Time
Label5.Caption = Environ("Username")
'SET UP MULTIPAGES
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.
pt