作者:乔山办公网日期:
返回目录:excel表格制作
你有打开文件吗?该文件vb编辑器设了密码吗?
编写个宏来实现吧,帮你写出来了
Private Sub Worksheet_Change(ByVal Target As Range)
For i = 2 To 1000
If Cells(i, 3) < 31 Then
Cells(i, 4).Interior.ColorIndex = 2
ElseIf Cells(i, 3) < 46 Then
Cells(i, 4).Interior.ColorIndex = 6
ElseIf Cells(i, 3) < 61 Then
Cells(i, 4).Interior.ColorIndex = 9
ElseIf Cells(i, 3) < 91 Then
Cells(i, 4).Interior.ColorIndex = 7
ElseIf Cells(i, 3) < 181 Then
Cells(i, 4).Interior.ColorIndex = 3
End If
Next i
End Sub
怎么用知道吧,在e799bee5baa6e997aee7ad94e58685e5aeb9335EXCEL里面按Alt+F11,在VB编辑器中点击sheet1,然后输入以上函数喉退出VB编辑器就行了,在excel上输入任意东西函数就启动。 这样算不算例子。。