Excel单元格所在的行和列变色VBA代码: Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
On Error Resume NextCells.FormatConditions.DeleteWith Target.EntireRow.FormatConditions .Delete .Add xlExpression, , "TRUE" .Item(1).Interior.ColorIndex = 8 End WithWith Target.EntireColumn.FormatConditions .Delete .Add xlExpression, , "TRUE" .Item(1).Interior.ColorIndex = 8 End With End Sub
点击加入群:Excel部落结识Excel大神学好Excel,效率成倍提高,薪水稳步增长,职位快速提升
每天一个源创技巧,如觉得有用,请点上面关注。更重要手机转发分享