1. Click on the developer tab in the menu bar
2. Click on the drop-down arrow below insert
3. Select the rectangular command button from the ActiveX controls
4. Select a convenient location and then click and drag the mouse button to draw a command button
5. Double click on the command button
6. Between the 2 lines of code that you will see in the Visual Basic Editor (VBE) Window just copy and paste the following code:
Dim i as integer
For i = 1 To 1000
If Cells(i, 1) = 2 Then
Range(Cells(i, 1), Cells(i, 10)).Interior.ColorIndex = 13
Cells(i, 1).Font.ColorIndex = 2
End If
Next i
7. Now close the VBE window and come back to your Excel worksheet
8. Click on the developer tab in the menu bar
9. Click on 'Design' to exit the design mode
10. Now click on the Command Button1
11. The relevant row will be highlighted purple and if the first cells values are 2 then the font of the value 2 will become white
Bookmarks