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

シートタブ名をExcelのセル値と等しくする方法は?

場合によっては、指定したセル値に基づいてワークシートの名前を変更する必要があります。 この記事では、シートタブ名をExcelのセル値と等しくする方法を紹介します。

シートタブ名をVBAコードでセル値と等しくする
Kutools for Excelを使用して、シートタブ名をセル値と等しくする


シートタブ名をVBAコードでセル値と等しくする

次のVBAコードを使用すると、シートタブ名をセル値と自動的に等しくすることができます。

1.シート名をセル値と等しくするシートタブを右クリックし、をクリックします コードを表示 右クリックメニューから。 スクリーンショットを参照してください:

2.以下のコードをコピーしてコードウィンドウに貼り付け、を押します。 他の + Q キーを同時に押して、Microsoft Visual Basic forApplicationsウィンドウを閉じます。

VBAコード:シートタブをセル値と等しくする

Private Sub Worksheet_Change(ByVal Target As Range)
'Updated by Extendoffice 20230130
    On Error Resume Next
    If Not Intersect(Target, Range("A1")) Is Nothing Then
        ActiveSheet.Name = ActiveSheet.Range("A1")
    ElseIf Not Intersect(Target.Dependents, Range("A1")) Then
        ActiveSheet.Name = ActiveSheet.Range("A1")
    End If
End Sub

Note:コードでは、A1はシート名として使用する必要のある値を含むセルです。 必要に応じて変更できます。

これ以降、セルA1の値が変更されると、シートタブ名も同様に変更されます。


Kutools for Excelを使用して、シートタブ名をセル値と等しくする

このセクションでは、 複数のワークシートの名前を変更する の有用性 Kutools for Excel。 このユーティリティを使用すると、Excelで特定のセルの値を使用してワークシートの名前を簡単に変更できます。

申請する前に Kutools for Excelについては 最初にダウンロードしてインストールします.

1。 クリック クツールズプラス > ワークシート > 複数のワークシートの名前を変更する。 スクリーンショットを参照してください:

2。 の中に 複数のワークシートの名前を変更する ダイアログボックスでは、次のようにする必要があります。

1)。 名前を変更するワークシート名を ワークシート ボックス(XNUMX枚または複数枚選択可能)。
2)。 選択する 元のシート名を置き換える 内箱 オプションの名前変更 のセクションから無料でダウンロードできます。
3)。 指定したセルの値でXNUMXつまたは複数のワークシートの名前を変更する場合は、 特定の範囲から オプションをクリックし、シートの名前を変更するセルの範囲を選択します。
4)。 クリック OK ボタン。 スクリーンショットを参照してください:

以下のスクリーンショットに示すように、選択したワークシートの名前が指定した範囲値ですぐに変更されていることがわかります。

ノート:

1。 あなたは フィルタ ワークシートがたくさんある場合に必要なワークシートを簡単に除外する機能。
2.各シートの特定のセル値で複数のワークシートの名前を変更する場合。 たとえば、sheet1はそのセルA1の値と等しくなり、sheet2もそのセルA1の値と等しくなります。 でワークシートを選択してください ワークシート ボックスをクリックし、 ワークシートの名前を特定のセルに変更する オプションを選択し、ボックスにセルA1を指定します。

3.セルの値が変更されても、シート名は自動的に変更されません。

  このユーティリティの無料トライアル(30日)が必要な場合は、 クリックしてダウンロードしてください、次に、上記の手順に従って操作を適用します。


Kutools for Excelを使用して、シートタブ名をセル値と等しくする

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

🤖 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 (30)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Good
It was the same thing I was looking for. But now I have a question:
After these steps were done, I created several sheets, I locked the sheet, but when I lock the book and enter a value in the cell, the name of the sheet does not change. In other words, it only changes with the spreadsheet unlocked and I would like to keep the spreadsheet locked
This comment was minimized by the moderator on the site
Boas
Era mesmo isto que estava a procurar. Mas agora tenho uma questão:
Após esses passos feitos, criei várias sheet, bloqueei a folha, mas quando bloqueio o livro e digito um valor na célula, o nome da sheet não muda. Ou seja, só muda com a sheet desbloqueada e gostaria de manter a sheet bloqueada
This comment was minimized by the moderator on the site
bonjour,
que voulez-vous dire par appuyer autre autre+q dans le code vba après avoir collé.
J'ai simplement fermé la page après avoir collé et ça ne marche pas
merci
This comment was minimized by the moderator on the site
worked beautifully!
This comment was minimized by the moderator on the site
Hi Crystal,

When i paste in your code it comes back with error "user-defined type not defined"?

Thanks.
This comment was minimized by the moderator on the site
Hi Tom J,
Make sure these three options are checked in the References - VBAProject dialog box.
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/error.png
This comment was minimized by the moderator on the site
This worked perfectly for my first worksheet, but not for the second or third etc (I have up to about 20 worksheets that all need this function). Am I missing something?
This comment was minimized by the moderator on the site
Hi A Owen,
This code only works for one worksheet per time. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
What is the highest nr of worksheets, that can be changed names via Kutools Plus? because the excel letting me only 17 names to changes, and that's it
This comment was minimized by the moderator on the site
I'm using your exact code from the above for VBA code which works perfectly for what I need. However, I have a bunch of macros on a sheet called Job Template that gets copied and reused for every new job. I designed all my macros based on a new copied version called Job Template (2). Once the sheet name is changed to the new job name, the macros no longer work and have to manually do it. I would like to be able to use any of my Macro buttons at any point instead of only using them before I change the sheet name.

Is there a way for the VBA code to always refer to the sheet name before running the rest of the code functions?
This comment was minimized by the moderator on the site
How can I reference two cells. for example name and id number?
This comment was minimized by the moderator on the site
This is exactly what I need, but I need the tab to recreate a date and it isn't working... I assume this is something to do with the way excel works out date and time, can anyone suggest a workaround?
This comment was minimized by the moderator on the site
Hi Nick,
Excel does not support typing the sheet name containing special characters. If the date you type contains the character /, it won't allow you to create the sheet name with that date.
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