Hi Team,
I am trying to learn applying multiple label, below is my attempted code.
please assist how to apply properly with message. thanks in advance for your help !
Thanks
mg
I am trying to learn applying multiple label, below is my attempted code.
please assist how to apply properly with message. thanks in advance for your help !
VBA Code:
Sub test()
Dim i As Long
For i = 2 To 14
If Cells(i, 1).Value = 30 Then
On Error GoTo Amt_30
ElseIf Cells(i, 1).Value = 40 Then
On Error GoTo Amt_40
ElseIf Cells(i, 1).Value = 50 Then
On Error GoTo Amt_50
Else
Cells(i, 1).Font.Bold = True
End If
Next i
Done:
Exit Sub
Amt_30:
MsgBox "We found value 30"
Amt_40:
MsgBox "We found value 40"
Amt_50:
MsgBox "We found value 50"
End Sub
Book13 | |||
---|---|---|---|
A | |||
1 | SR No | ||
2 | 3 | ||
3 | 4 | ||
4 | 20 | ||
5 | 8 | ||
6 | 1 | ||
7 | 30 | ||
8 | 3 | ||
9 | 40 | ||
10 | 5 | ||
11 | 8 | ||
12 | 1 | ||
Sheet1 |
Thanks
mg