在Excel中隐藏公式栏以获取特定文件 [英] Hiding the formula bar in Excel for a specific file

查看:179
本文介绍了在Excel中隐藏公式栏以获取特定文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将公式栏隐藏在特定的Excel文件中,仅在此文件中。我知道我们可以使用VBA(Application.DisplayFormulaBar = False)来完成它,但是我想知道是否还有其他解决方案就像编辑CustomUI文件一样。

I would like to hide the formula bar in a specific Excel file and only in this file. I know we can do it with VBA (Application.DisplayFormulaBar = False) but I am wondering if there is another solution like editing the CustomUI file.

通常我编辑CustomUI文件隐藏功能区,添加自定义选项卡...如果我们可以以这种方式隐藏公式栏,这将是很好的。

Usually I edit the CustomUI file for hiding ribbon, adding custom tabs, ... It would be nice if we can hide the formula bar in this way.

任何建议?

谢谢。

推荐答案

简答案是:您不能。

不幸的是,您无法通过编辑CustomUI文件来隐藏它。公式栏必须使用VBA隐藏。话虽如此,您可以在Workbook_open事件上运行隐藏操作。

Unfortunately, you cannot hide it by editing the CustomUI file. The formula bar has to be hidden using VBA. That being said, you can just run the hide operation on the Workbook_open event.

Private Sub Workbook_Open() 
    Application.DisplayFormulaBar = False 
End Sub 

您可以根据活动如下所示:

You can turn it on/off depending on the active sheet like so:

Private Sub Workbook_SheetActivate(ByVal Sh As Object)

If Sh.Name = "Sheet1" Then
    Application.DisplayFormulaBar = False
Else
    Application.DisplayFormulaBar = True
End If

End Sub

这篇关于在Excel中隐藏公式栏以获取特定文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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