VBA隐藏单元格 [英] VBA to Hide Cells

查看:232
本文介绍了VBA隐藏单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在执行一个宏,需要它来执行一个额外的任务。我需要它来完全隐藏一系列细胞。我发现我可以隐藏写作:


Sheet1.Range(adminRange).Font.Color = vbWhite


并将其带回:


Sheet1.Range(adminRange).Font.Color = vbBlack


但这会让边框可见。


我试过:


Sheet3.Range(" A1:E10")。Borders.Color = vbwhite


to隐藏边框,但它没有用。


我还需要隐藏一些位图,但只有2个,所以我满足于一次做一些事情那些。


有什么建议吗?





解决方案

Hello DaronRyan,


您正在做的是更改文本的颜色,以便它不能弄清楚。它不是隐藏单元格的方法,Excel不支持单独隐藏单元格。 


如果要隐藏某些单元格,则必须隐藏单元格的整个行或列。


代码类似于。

 Sheet1.Range(" A1:E10")。EntireRow.Hidden = True 

最好的问候,


特里




I am executing a macro and need it to perform an additional task. I need it to completely hide a range of cells. I have discovered I can hide the writing:

Sheet1.Range(adminRange).Font.Color = vbWhite

and bring it back with:

Sheet1.Range(adminRange).Font.Color = vbBlack

but this is leaving borders visible.

I have tried:

Sheet3.Range("A1:E10").Borders.Color = vbwhite

to hide the borders but it has not work.

I will also need to hide some bit maps but there is only 2 of them so I am content to do something one at time on those.

Any suggestions?


解决方案

Hello DaronRyan,

What you are doing is change the color of the text so it could not be figure out. It is not a way to hide cells and Excel does not support to hide cells singly. 

If you want to hide some cells, you have to hide the cells entire rows or columns.

Code will be something like.

Sheet1.Range("A1:E10").EntireRow.Hidden = True

Best Regards,

Terry


这篇关于VBA隐藏单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆