K
K
Hi all, I got macro (see below)
Private Function LabelNormal()
On Error Resume Next
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is Label And ctl.Name <> "Label10" And ctl.Name <>
"Label9" Then
With ctl
.SpecialEffect = 1 'Raised
.BackColor = 8421504 'Grey
.ForeColor = 16777215 'White
.FontWeight = 400 'Normal
End With
End If
Next
End Function
the above macro fine but I want to change the line where it say
If TypeOf ctl Is Label And ctl.Name <> "Label10" And ctl.Name <>
"Label9" Then
to
If TypeOf ctl Is Label And ctl.Name <> Array("Label10" , "Label9")
Then
I tried it but its not working. Basically I want macro to go through
all the names I put in Array and change only those controls which
names are not array. Please can any friend can help as I always had
problem creating array in macros
Private Function LabelNormal()
On Error Resume Next
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is Label And ctl.Name <> "Label10" And ctl.Name <>
"Label9" Then
With ctl
.SpecialEffect = 1 'Raised
.BackColor = 8421504 'Grey
.ForeColor = 16777215 'White
.FontWeight = 400 'Normal
End With
End If
Next
End Function
the above macro fine but I want to change the line where it say
If TypeOf ctl Is Label And ctl.Name <> "Label10" And ctl.Name <>
"Label9" Then
to
If TypeOf ctl Is Label And ctl.Name <> Array("Label10" , "Label9")
Then
I tried it but its not working. Basically I want macro to go through
all the names I put in Array and change only those controls which
names are not array. Please can any friend can help as I always had
problem creating array in macros