メインコンテンツへスキップ

数式を非表示にして、Excelでワークシートを保護せずに結果を表示するにはどうすればよいですか?

場合によっては、プライベート用にワークシートで数式を非表示にする必要があります。 この記事では、数式を非表示にするが、Excelでワークシートを保護せずに結果を表示する方法について説明しています。

数式を非表示にしますが、VBAコードでワークシートを保護せずに結果を表示します


数式を非表示にしますが、VBAコードでワークシートを保護せずに結果を表示します

数式を非表示にして、ワークシートを保護せずに結果を表示するには、次のようにします。

1.ワークシートで数式を非表示にする必要がありますが、結果を表示するには、シートタブを右クリックして、を選択してください。 コードを表示 右クリックメニューから。

2。 の中に アプリケーション向け Microsoft Visual Basic ウィンドウの場合は、VBAコードをコピーしてコードウィンドウに貼り付けてください。

VBAコード:数式を非表示にしますが、ワークシートを保護せずに結果を表示します

Dim xDic As New Dictionary
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim xCell As Range
    Dim xRg As Range
    Set xRg = Range("C1:C10")
    If xDic.Count <> xRg.Count Then
        For Each xCell In xRg
            xDic.Add xCell.Address, xCell.FormulaR1C1
        Next
    End If
    If (Target.Count = 1) And (Not Application.Intersect(xRg, Target) Is Nothing) And (Target.HasFormula) Then
        With Target
            .Value = .Value
        End With
    Else
        For Each xCell In xRg
            xCell.Formula = xDic.Item(xCell.Address)
        Next
    End If
End Sub

Note:コードでは、C1:C10は、数式を非表示にするセル範囲です。 必要に応じて変更してください。

3。 次に、をクリックします ツール > 参考文献…。 チェック Microsoftスクリプトランタイム ボックスをクリックして OK ボタンの 参照– VBAProject 窓。 スクリーンショットを参照してください:

4。 プレス 他の + Q を閉じるためのキー アプリケーション向け Microsoft Visual Basic 窓。

これ以降、指定した範囲のセルをクリックすると、数式は数式バーにすぐに非表示になります。


関連記事:

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
Comments (20)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
saya da coba sesuai coding nya, bisa berjalan, tetapi di layar ketika saya klik ke tempat yang dimaksud ada keluar tanda loading, (tanda bulat berkedip). File saya mmg 18 MB, bagaimana caranya agar tidak keluar tanda kedip tersebut ?
This comment was minimized by the moderator on the site
Hi akkia,
The problem you mentioned is not reproduced in my case. May I ask which Excel version you are using?
This comment was minimized by the moderator on the site
dia tetap loading ya ko ?
This comment was minimized by the moderator on the site
Thank you for this code, I really needed something like this
Rated 5 out of 5
This comment was minimized by the moderator on the site
formula worked but the problem is when we close the sheet and reopen it than VBA not worked...
This comment was minimized by the moderator on the site
Hi, To continue using this VBA in future, after adding the code, please save the workbook as an Excel Macro-Enabled Workbook.Click File > Save As. In the Save As dialog box, select Excel Macro-Enabled Workbook from the Save as type drop down list, then click the Save button.And then use this excel macro-enabled workbook in the future.
This comment was minimized by the moderator on the site
Hi Im gracy, i am trying to hide the formula in a particular column without password protecting the sheet. i copy pasted the entire code and changed the cells but still unable to hide the formula. Can you please assist.

This comment was minimized by the moderator on the site
Thank you. Formula Worked.
This comment was minimized by the moderator on the site
after this vba code apply new sum formula result not showing in cell, please help....
This comment was minimized by the moderator on the site
If we press and hold the mouse left click to a cell, the formula shows until you release the left click. Otherwise this should work fine.
This comment was minimized by the moderator on the site
I tried using the VBA code but after applying this code my excel is getting slow and hanged.please help me in resolving this issue.
This comment was minimized by the moderator on the site
There is easy way as well.
Select the cell or cells you want to hide the formula or data.
Go to Home --> Format --> Format Cells --> Number --> Custom
Under Type, Remove General and Enter """"
The cell value or formula do not appear on the screen
However it will appear in the Formula bar if you select the cell.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations