Private Sub ListBox1_Click()
For i = 2 To 13
If Sheet1.Cells(i, 1).Value = Me.ListBox1.Column(0) Then
Sheet1.Cells(i, 1).Interior.Color = vbGreen
Sheet1.Cells(i, 1).Borders.Color = vbRed
Sheet1.Cells(i, 1).Font.Color = vbRed
Else
Sheet1.Cells(i, 1).Interior.Color = vbWhite
Sheet1.Cells(i, 1).Borders.Color = vbBlack
Sheet1.Cells(i, 1).Font.Color = vbBlack
End If
Next i
End Sub
Private Sub UserForm_Initialize()
Me.ListBox1.Selected(0) = True
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
For i = 2 To 13
Sheet1.Cells(i, 1).Interior.Color = vbWhite
Sheet1.Cells(i, 1).Borders.Color = vbBlack
Sheet1.Cells(i, 1).Font.Color = vbBlack
Next i
End Sub
No comments:
Post a Comment
Please do not enter any spam message in comment box