OliverQin

需求描述

在点击单元格的时候,单元格所在行与列都变色显示


实现方案

打开Excle表格,按住ALT+F11

image

双击上图中的ThisWorkbook

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    Cells.Interior.Pattern = xlNone
    Rows(Target.Row).Interior.ColorIndex = 3
    Columns(Target.Column).Interior.ColorIndex = 4
End Sub

代码中的3、4为颜色标记,具体参照下图:

image


将上述代码贴入

image

然后另存表格为变色.xlsm

分类:

技术点:

相关文章:

  • 2021-12-05
  • 2021-12-11
  • 2021-12-03
  • 2021-11-26
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2021-10-16
猜你喜欢
  • 2021-12-22
  • 2021-09-20
  • 2022-02-14
  • 2021-05-19
  • 2021-08-29
  • 2022-12-23
相关资源
相似解决方案