excel怎么批量选中单元格 Excel 怎么设定 选中一个单元格后,整行/整列的颜色都变化
Excel 怎么设定 选中一个单元格后,整行/整列的颜色都变化

Excel 怎么设定 选中一个单元格后,整行/整列的颜色都变化
Private Sub Worksheet_Change(ByVal Target As Range)
If Application.CutCopyMode <> False Then
Application.CutCopyMode = False
End If
Call colorset(Target)
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.CutCopyMode = False Then
Call colorset(Target)
Else
Exit Sub
End If
End Sub
Private Sub colorset(ByVal rngtarget As Range)
If rngtarget.Count > 1 Then
Cells.Interior.ColorIndex = 0
Exit Sub
End If
Rows.Interior.ColorIndex = 0
x = ActiveCell.Row
y = ActiveCell.Column
Rows(x).Interior.ColorIndex = 20
Columns(y).Interior.ColorIndex = 35
ActiveCell.Interior.ColorIndex = 15
End Sub
在程式码里面复制上面就好了
使用工作表事件吧
vba实现
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Application.ScreenUpdating = False ActiveSheet.Cells.Interior.ColorIndex = 0 Target.EntireRow.Interior.ColorIndex = 3 Target.EntireColumn.Interior.ColorIndex = 3 Application.ScreenUpdating = TrueEnd SubEXCEL怎样实现选中一个单元格,此单元格所在的整行整列变黄色
exhome小组有个外挂,叫易用宝,免费的,其中有个“聚光灯”功能可实现
excel2007中如何用巨集设定选中一个单元格,整行都用其他颜色选中,但只对选中的单元格编辑?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Columns().Interior.ColorIndex = 0
y = ActiveCell.Row
Rows(y).Interior.ColorIndex = 4
End Sub
参考:dzwebs./3619.此处程式码excel2003实验通过