点击excel某单元格,可以变成另外一个颜色吗?

2024-12-16 23:40:03
推荐回答(3个)
回答1:

可以。在指定单元格右键、设置单元格格式、图案、选个颜色,确定。

回答2:

同时按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

回答3:

如果点一个就不会,选中几个就会