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

Excelのセル/ヘッダーまたはフッターにファイル名またはパスを挿入するにはどうすればよいですか?

ファイル名またはファイルパスをExcelのセル、ヘッダー、またはフッターに挿入する場合、この操作をすばやく実行するにはどうすればよいでしょうか。

数式を使用してセルに現在のファイル名またはパスを挿入します

ヘッダーとフッター機能を使用して、現在のファイル名またはパスをヘッダー/フッターに挿入します

Kutools for Excelを使用して、現在のファイル名またはパスをセル/ヘッダーまたはフッターに挿入します 良いアイデア3


矢印青い右バブル 数式を使用してセルに現在のファイル名またはパスを挿入します

次の数式を使用すると、指定したセルにファイル名、パス、またはシート名をすばやく挿入できます。

アイテム価格
ファイル名のみ = MID(CELL( "filename")、SEARCH( "["、CELL( "filename"))+ 1、SEARCH( "]"、CELL( "filename"))-SEARCH( "["、CELL( "filename "))-1) 製品features.xlsx
ファイルパスのみ = LEFT(CELL( "filename"、A1)、FIND( "["、CELL( "filename"、A1)、1)-1) C:\ Users \ dt \ Desktop \ New folder \
アクティブなシート名のみ = RIGHT(CELL( "filename")、LEN(CELL( "filename"))-FIND( "]"、CELL( "filename")、1)) Sheet7
現在のファイル名、ファイルパス、アクティブなシート名 = CELL( "ファイル名") C:\ Users \ dt \ Desktop \ New folder \ [products features.xlsx] Sheet7

注意:

1.必要な上記の数式を指定したセルにコピーすると、必要な結果が得られます。

2.開いたブックが保存されている必要があります。


矢印青い右バブル ヘッダーとフッター機能を使用して、現在のファイル名またはパスをヘッダー/フッターに挿入します

ファイル名またはファイルパスをwotksheetヘッダーまたはフッターに挿入する場合は、Header&Footer関数を使用できます。

1。 リボンで、をクリックします インセット > ヘッダーとフッター.

2。 ヘッダーまたはフッターセクションにXNUMXつの編集ボックスがあります。クリックしてください , センター or 鳴る ファイル名またはパスを挿入するボックス。 その後、 設計 タブをクリックします。 ファイルパス, ファイル名 or シート名 挿入する必要があります。 スクリーンショットを参照してください:

doc-挿入-ファイル名-パス1

次に、任意のセルをクリックすると、ファイルパス、名前、またはシート名がフッターのヘッダーに挿入されていることがわかります。 スクリーンショットを参照してください:

ファイルパスをヘッダーに挿入します
doc-挿入-ファイル名-パス2
ファイル名をフッターに挿入します
doc-挿入-ファイル名-パス3

矢印青い右バブル Kutools for Excelを使用して、現在のファイル名またはパスをセル/ヘッダーまたはフッターに挿入します

Kutools for Excelさん ワークブック情報を挿入する は多機能ツールであり、ワークシート名、ワークブック名​​、ワークブックパス、またはワークブックパスと名前をExcelのセル、ヘッダー、またはフッターにすばやく便利に挿入するのに役立ちます。

Kutools for Excel, 以上で 300 便利な機能で、仕事が楽になります。 

インストールした後 Kutools for Excel、以下のようにしてください:(今すぐExcel用のKutoolsを無料でダウンロードしてください!)

1に設定します。 OK をクリックします。 クツールズプラス > ワークブックツール > ワークブック情報を挿入する、スクリーンショットを参照してください:

ドキュメント挿入ワークブック情報3

2。 の中に ワークブック情報を挿入する ダイアログボックスで、左側のペインから挿入するブック情報を選択し、情報を挿入する場所を選択します。 スクリーンショットを参照してください:

ドキュメント挿入ワークブック情報2

3。 次に、をクリックします OK。 wotkbook情報をセルに挿入すると、次のような結果が得られます。

doc-挿入-ファイル名-パス6

ブック情報をヘッダーまたはフッターに挿入する場合、情報を挿入する場所を選択できます。 , or センター。 そして、あなたはからヘッダーまたはフッターをプレビューすることができます 詳しく見る > ページレイアウト.

この機能の詳細については、次のWebサイトをご覧ください。 ワークブック情報を挿入する.

矢印青い右バブル ワークブック情報を挿入する

ヒント。n行ごとに複数の空白行または列を挿入する場合は、Kutools forExcelを使用してみてください。 空白の行と列を挿入する 次のスクリーンショットに示すように。 60日で無制限にフル機能、 今すぐダウンロードして無料トライアルをお試しください。

Excelの範囲内の特定の間隔で空白の行または列をバッチ挿入します

XNUMX行おきに空白行を挿入する場合は、XNUMX行ずつ挿入する必要がありますが、 空白の行と列を挿入する of Kutools for Excel この仕事を数秒で解決できます。 30日間の無料トライアルをクリックしてください!
doc挿入空白行列
Kutools for Excel:300を超える便利なExcelアドインがあり、30日以内に制限なしで無料で試すことができます。

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

🤖 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 (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
What's the function to display and file path and file name WITHOUT the active sheet name? Example: C:\Users\dt\Desktop\New folder\products features.xlsx
This comment was minimized by the moderator on the site
Hello, Lydeth Chea
To only display the file path and name without the sheet name, please apply the below formua:
=SUBSTITUTE(LEFT(CELL("filename"), FIND("]", CELL("filename"))-1), "[", "")


Please have a try, thank you!
This comment was minimized by the moderator on the site
Is there an automated way to pass the current Excel filename (no file path, no extension) to the current worksheet name?
This comment was minimized by the moderator on the site
Is it possible to turn a file path in an excel print title into a clickable hyperlink? I would like to publish the excel file as a pdf with a clickable hyperlink in the footer.
This comment was minimized by the moderator on the site
Hi I have about 90 workbooks, and in each workbook i have 5 sheets, i want to put in a new column in every sheet across these workbooks to input the year.
This comment was minimized by the moderator on the site
Hi, correct formula for filename without path is: =MID((CELL("filename"));((SEARCH("[";(CELL("filename"))))+1);((SEARCH("]";(CELL("filename"))))-((SEARCH("[";(CELL("filename"))))+1))) (semicolon in MID and SEARCH funtions, and -1 --> +1 at the end) bye
This comment was minimized by the moderator on the site
For filename without extension: =MID(CELL("filename"),SEARCH("[",CELL("filename"))+1,SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-5)
This comment was minimized by the moderator on the site
This gives an error.
This comment was minimized by the moderator on the site
shouldn't be 6?
This comment was minimized by the moderator on the site
-6 was the correct for me on MS Office 2016 :)
This comment was minimized by the moderator on the site
On mine it works well. However, it finishes with a "." at the end. If you put 6 instead it will return without the ".". It basically works counting the characters which "+1" in the formula is the first character and the "-5" is the amount of characters that are not showing counting from the front. So, if you want to catch only the middle characters eg. (XXXXX from a document named ZZ-YY-WW-XXXXX from a extension .xlsm) you can input as per below:

=MID(CELL("filename"),SEARCH("[",CELL("filename"))+10,SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-15)
This comment was minimized by the moderator on the site
when i am using this function in excel 1 (this is the filename) , and then i open excel 2, the cell in excel 1 changes from "excel 1" to "excel 2". Please advise, how to prevent this.
This comment was minimized by the moderator on the site
Yes, I am having the same problem, this formula seems to point to a variable that is not tied to the actual spreadsheet of the cell the formula exists in but instead to the currently selected spreadsheet or similar.
This comment was minimized by the moderator on the site
I have the same problem when opening a different excel document. Is there a way to leave the file name with the current file?
This comment was minimized by the moderator on the site
You prolly already found this solution. But I figured I'd add it for any future searchers. :-) Simply add the third option, the "A1" reference, to each of the CELL functions as follows: =CELL("filename",A1) =SUBSTITUTE( LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1),"[","") =MID(CELL("filename",A1),SEARCH("[",CELL("filename",A1))+1, SEARCH("]",CELL("filename",A1))-SEARCH("[",CELL("filename",A1))-1)
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations