当前位置:网站首页>excel表格中选中单元格出现十字带阴影的选中效果
excel表格中选中单元格出现十字带阴影的选中效果
2022-07-02 09:38:00 【早上起床买豆浆】
基于VBA实现Excel十字交叉高亮显示
偶然需要到这个功能,微软的EXCEL表格实现选中单元格出现十字带阴影的选中效果;
找了一些方法,再次做详细记录,看此文基本解决标题所述问题。
一、格式要求
首先,文件格式必须为.xlsm格式,如果不是该格式,设置的效果在关闭excel表格后重新打开,大概率会失效。
二、具体步骤
1**、 打开vbe编辑器**
方法:ALT+F11
2、双击左侧thisworkbook标签,并粘贴代码
代码如下:
'注意此方法会去掉单元格已有的背景色
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Cells.Interior.ColorIndex = xlNone
Target.EntireRow.Interior.Color = RGB(230, 250, 230) '行样式
Target.EntireColumn.Interior.Color = RGB(230, 250, 230) '列样式
Target.Interior.Color = RGB(255, 255, 255) '单元格样式
End Sub
然后保存该步骤。ctrl+S(弹框提示点击: 是)
3、实现效果,达到目的;
如此,便实现了excel表格中选中单元格出现十字带阴影的选中效果,希望能够帮到有需要的人,不妨点个赞。
边栏推荐
- Implementation of six singleton modes
- LVM操作
- [idea] use the plug-in to reverse generate code with one click
- Amazon cloud technology community builder application window opens
- 基于Hardhat和Openzeppelin开发可升级合约(二)
- Is the stock account given by qiniu business school safe? Can I open an account?
- MySQL linked list data storage query sorting problem
- Develop scalable contracts based on hardhat and openzeppelin (II)
- Gaode draws lines according to the track
- enumrate的start属性的坑
猜你喜欢
随机推荐
Tick Data and Resampling
从攻击面视角,看信创零信任方案实践
Iii. Système de démarrage et d'horloge à puce
On April 17, 2022, the five heart matchmaker team received double good news
Is the Ren domain name valuable? Is it worth investing? What is the application scope of Ren domain name?
2022 love analysis · panoramic report of digital manufacturers of state-owned enterprises
tidb-dm报警DM_sync_process_exists_with_error排查
deepTools对ChIP-seq数据可视化
mysql 基本语句
TIPC Cluster5
基于Hardhat编写合约测试用例
MySQL linked list data storage query sorting problem
liftOver进行基因组坐标转换
Redis超出最大内存错误OOM command not allowed when used memory > 'maxmemory'
程序员成长第六篇:如何选择公司?
QT learning diary 7 - qmainwindow
LVM operation
Is the stock account given by qiniu business school safe? Can I open an account?
在网上开股票账户安全吗?我是新手,还请指导
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘








