excel选中表格显示的颜色

  • 格式:docx
  • 大小:26.50 KB
  • 文档页数:7


1 7
竭诚为您提供优质文档/双击可除

excel选中表格显示的颜色

篇一:excel如何设置选中一格后所在列和行都有颜色
excel如何设置选中一格后所在列和行都有颜色第一步
按住alt键不放,再按F11调出Vba
第二步在Vba中双击左侧的sheet1
第三步在右边复制以下代码
第四步关闭Vba

privatesubworksheet_selectionchange(byValtargetasRa
nge)
withtarget
.parent.cells.interior.colorindex=xlnone
.entireRow.interior.colorindex=6
.entirecolumn.interior.colorindex=6
endwith
endsub

2 7
备注:
代码中的两个=6是背景颜色为黄色
=7是粉红色可以修改数字改变背景颜色
.parent.cells.interior.colorindex=xlnone
清除工作表单元格的背景色
.entireRow.interior.colorindex=6
设置选中区域所在行的背景色
.entirecolumn.interior.colorindex=6
设置选中区域所在列的背景色
下边是excel20xx颜色代码
篇二:改变excel表格鼠标选定区域颜色
改变excel表格鼠标选定区域颜色
1、excel20xx——工具——宏——安全性——设置为低。
excel20xx——选项——信任中心——启用所有宏。
2、右键你需要的工作表如sheet1——查看代码。粘贴
如下代码。(注意换行)

privatesubworksheet_selectionchange(byValtargetasRa
nge)

cells.interior.colorindex=0target.interior.colorind
ex=15

3 7
endsub
3、改变第3行代码15的值。将15改成其他。你看哪
个是你想要的就可以了。15、16、19、20、24颜色比较淡雅。
篇三:excel选中变色
[excel]加亮显示选中单元格的所在行与列
我们经常会遇到这种情况,当某条记录有较多字段时,
我们选中了这一行或这一行的某个单元格,要查看该记录的
其它内容时,常常会感到眼睛比较累,有时还会看走眼,看
到其它的记录行去了。如果能让选中的这一行突出显示出来,
以区别于其它记录行,就不会出现这种情况了。这样,在工
作表中进行选择时,也会感到较为轻松。
为了能够突出显示被选单元格所在行,我们就需要知道
该单元格所在的行号,再依此改变该行部分或全部单元格的
填充颜色即可。要实现这一功能,就要借助于Vba和单元格
的条件格式功能了。
右击工作表标签,从弹出的快捷菜单中选择:“查看代
码”,或者按下alt+F11组合键,进入Vba代码窗口,键入
如下代码:(代码有以下几种,可根据用户的需要进行选择,
不够都有个缺点就是不能在本工作表内无法进行复制粘贴
操作,若有哪位知道的话,请留言告诉我下,学习学习!)
一、行列都变色,可填充,不能复制,可多行多列变色、
可不断变化各种色彩(推荐使用)

4 7
privatesubworksheet_selectionchange(byValtargetasex
cel.Range)
onerrorResumenext
cells.Formatconditions.delete
icolor=int(50*Rnd()+2)
withtarget.entireRow.Formatconditions
.delete
.addxlexpression,,"tRue"
.item(1).interior.colorindex=icolor
endwith
withtarget.entirecolumn.Formatconditions
.delete
.addxlexpression,,"tRue"
.item(1).interior.colorindex=icolor
endwithendsub
二、行变色,可填充,不能复制,可多行变色、可不断变
化各种色彩(推荐使用)
privatesubworksheet_selectionchange(byValtargetasex
cel.Range)onerrorResumenext
cells.Formatconditions.delete
withtarget.entireRow.Formatconditions
.delete