【Vegas原创】EXCEL光标所在的行自动变色


image

 

方法:

1,excel中,按Alt+F11,打开VBA编辑界面,双击需要改的工作表名称,将下面代码粘贴到右边框中,即可。image

2,代码:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = 0
Rows(Target.Row).Interior.ColorIndex = 34
End Sub

 

3,如果想变颜色,改这句代码的值:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = 0
Rows(Target.Row).Interior.ColorIndex = 34
End Sub

 

4,ColorIndex值列表:


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM