可以。在指定单元格右键、设置单元格格式、图案、选个颜色,确定。
同时按Alt和F11,进入VB界面在左上角的窗口中选择你要实现功能的Sheet,右键,查看代码在右边出现的窗口里粘贴如下代码:Private rng As Range
Private cIdx As IntegerPrivate Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not (rng Is Nothing) Then
With rng.Interior
.ColorIndex = cIdx
End With
End If
If Not (Target Is Nothing) Then
cIdx = Target.Interior.ColorIndex
With Target.Interior
.ColorIndex = 41
End With
End If
Set rng = Target
End Sub
如果点一个就不会,选中几个就会