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

すべてのワークシートを値としてのみ保存するにはどうすればよいですか?

複数の数式を含むワークブックがある場合は、このファイルを他のユーザーに配布する必要があります。数式は表示せず、値のみを表示します。 通常、データを値としてのみコピーして貼り付けることで、ワークシートを値としてすばやく保存できます。 しかし、XNUMXつずつコピーして貼り付けることなく、すべてのワークシートを値としてのみ保存するにはどうすればよいでしょうか。

VBAコードのみを使用してすべてのワークシートを値として保存する


矢印青い右バブル VBAコードのみを使用してすべてのワークシートを値として保存する

次のVBAコードは、すべてのシートを値(数式なし)としてすばやく保存し、すべてのセルの書式を保持するのに役立ちます。 このようにしてください:

1。 を押し続けます Alt + F11 キーを押して アプリケーション向け Microsoft Visual Basic 窓。

2に設定します。 OK をクリックします。 インセット > モジュール、次のコードをに貼り付けます モジュール 窓。

VBAコード:すべてのワークシートを値としてのみ保存します。

Sub Saveasvalue()
'Updateby Extendoffice
    Dim wsh As Worksheet
    For Each wsh In ThisWorkbook.Worksheets
        wsh.Cells.Copy
        wsh.Cells.PasteSpecial xlPasteValues
    Next
    Application.CutCopyMode = False
End Sub

3。 次に、 F5 このコードを実行するためのキーであり、ブック全体が値としてのみ保存され、すべての数式が一度に削除され、値はセル形式のままになります。

Note:コードを適用する前に、最初にブックのコピーを保存できます。

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

🤖 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 (18)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
thanks for help
This comment was minimized by the moderator on the site
sämst shjkjhgasghjdfsjhkfdgsdjhgafgb,ja u fdsvjkhgfkjahfg ka khdfzhjkg
This comment was minimized by the moderator on the site
Hi,
This is what i'm using (I exit the file automatically so I won't save accidently with values only).

But I wanted to keep just one sheet saved "normally" because I have a drop down list there that I would not like to lose when sharing the file.


Can anyone help me do this?

Thank you!


<div data-tag="code">Sub Saveasvalue()

Dim wsh As Worksheet
For Each wsh In ThisWorkbook.Worksheets
wsh.Cells.Copy
wsh.Cells.PasteSpecial xlPasteValues
Next
Application.CutCopyMode = False

savename = Application.GetSaveAsFilename(fileFilter:="Exel Files (*.xlsx), *.xlsx")
ActiveWorkbook.SaveAs Filename:=savename, FileFormat:=51

Application.DisplayAlerts = False 'exit without alerts
Application.Quit
End Sub
This comment was minimized by the moderator on the site
It runs good but i need a VBA of paste as value for a bunch of excels workbooks.



This comment was minimized by the moderator on the site
Is there any way to undo this if you've forgotten to save down the formula version first?
This comment was minimized by the moderator on the site
I need to publish Excel based financial statements with groupings. This worked to clear all the formulae and leave just the numbers. Other methods I tried cleared the groupings.
This comment was minimized by the moderator on the site
Good! Excellent! I need this but no any sheets
This comment was minimized by the moderator on the site
Remove all filters/protection in all the sheets. should work perfectly.
This comment was minimized by the moderator on the site
Tengo ese código, si bien es cierto funciona pero quisiera que no considere algunas hojas de mi archivo excel. se puede ?
Saludos.
This comment was minimized by the moderator on the site
Funcionou!! Muito Bom!!!
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