Good afternoon,
I am trying to pull information from a spreadsheet into an Excel Userform, but I am having trouble on how to hide some of the none relevant data that is in label form that maynot be needed to be visible on the form.
So as the userform has 40 ish labels that dont always need to be visible I am hoping to update the relevant ones and hide the none relevant based on a number in my worksheet "Data" as below.
If "B1" is 1 as per below I need the labels below to show data, but the rest of the labels to be removed. I have put only 1 below but it could be 10 plus so I am unsure if I can hide them all as one in an array?
Sorry for being a bit vague, but I am unsure how to proceed.
thanks in advance
Gavin
I am trying to pull information from a spreadsheet into an Excel Userform, but I am having trouble on how to hide some of the none relevant data that is in label form that maynot be needed to be visible on the form.
So as the userform has 40 ish labels that dont always need to be visible I am hoping to update the relevant ones and hide the none relevant based on a number in my worksheet "Data" as below.
If "B1" is 1 as per below I need the labels below to show data, but the rest of the labels to be removed. I have put only 1 below but it could be 10 plus so I am unsure if I can hide them all as one in an array?
Sorry for being a bit vague, but I am unsure how to proceed.
Code:
Private Sub UserForm_Initialize()
Q1LoadFig = Worksheets("Data").Range("B1")
If Q1LoadFig >= 1 Then
Label3.Caption = Worksheets("pop Up Data").Range("B4").Text
Label27.Caption = Worksheets("pop Up Data").Range("B5").Text
Label28.Caption = Worksheets("pop Up Data").Range("B6").Text
Label29.Caption = Worksheets("pop Up Data").Range("B7").Text
Label30.Caption = Worksheets("pop Up Data").Range("B8").Text
Label31.Caption = Worksheets("pop Up Data").Range("B9").Text
'hide the following labels
Q1.Label14.Visible = False
End sub
thanks in advance
Gavin