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

Excelのセル範囲に接頭辞または接尾辞を追加するにはどうすればよいですか?

場合によっては、すべてのセルの最初または最後に共通のテキストを追加する必要があります。 もちろん、各セルにプレフィックスまたはサフィックスをXNUMXつずつ追加することもできます。 ただし、セルが多数ある場合、作業は大変で時間がかかります。 この記事では、Excelで選択したセル範囲に接頭辞または接尾辞を簡単に追加するためのヒントをいくつか紹介します。


数式を使用してすべてのセルに接頭辞または接尾辞を追加します

Excelの 連結する 関数は、単一のセルの接頭辞または接尾辞をすばやく挿入できます。

1。 の機能を入力してください =CONCATENATE("Food - ",A1) 空白のセルで、セルは言います C1、次に、このセルのオートフィルハンドルを、塗りつぶしたい範囲全体にドラッグします。 また、すべてのセルに特定のプレフィックステキストが追加されています。 スクリーンショットを参照してください:。 スクリーンショットを参照してください:

次のように、連結関数を使用して、プレフィックス、サフィックス、またはサフィックスとプレフィックスの両方を挿入できます。

数式を入力してください セルの結果
= Concatenate ("Food - ", A1) 食品-アップル
=Concatenate (A1, " - Fruit") アップル-フルーツ
=Concatenate ("Food - ", A1, " - Fruit") 食品–リンゴ–果物

Excelのすべてのセル(接頭辞または接尾辞)の最初または最後に共通のテキストを簡単に追加できます

オートフィル機能を使用すると、列内のすべてのセルに同じコンテンツを簡単に入力できます。 しかし、列内のすべてのセルに同じ接頭辞または接尾辞を追加するにはどうすればよいですか? 各セルに接頭辞または接尾辞を個別に入力することを比較すると、 Kutools for Excelさん Add Text ユーティリティは、数回クリックするだけでそれを実行するための簡単な回避策を提供します。


広告追加テキストプレフィックスサフィックス

VBAを使用してすべてのセルにプレフィックスまたはサフィックスを追加します

この問題は、次のVBAコードで処理することもできます。

1。 プレフィックスまたはサフィックスを挿入する範囲を選択します。

2に設定します。 OK をクリックします。 Developer > Visual Basic、および新しい Microsoft Visual Basic for applications ウィンドウが表示されたら、クリックします Insert > Module、次に次のコードを入力します。

VBA:テキストにプレフィックスを追加します:

Sub AddTextOnLeft()
'Updateby20131128
Dim Rng As Range
Dim WorkRng As Range
Dim addStr As String
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
addStr = Application.InputBox("Add text", xTitleId, "", Type:=2)
For Each Rng In WorkRng
    Rng.Value = addStr & Rng.Value
Next
End Sub

VBA:テキストにサフィックスを追加します:

Sub AddTextOnRight()
'Updateby20131128
Dim Rng As Range
Dim WorkRng As Range
Dim addStr As String
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
addStr = Application.InputBox("Add text", xTitleId, "", Type:=2)
For Each Rng In WorkRng
    Rng.Value = Rng.Value & addStr
Next
End Sub

3。 次に、をクリックします Run ボタンを押すか、 F5 VBAを実行するためのキー。

4。 そして、最初にプレフィックスまたはサフィックスを追加する範囲を指定してください KutoolsforExcel ダイアログボックスをクリックし、 OK ボタンをクリックし、XNUMX番目に追加するサフィックスまたはプレフィックスを入力します KutoolsforExcel ダイアログボックスをクリックし、 OK ボタン。 以下のスクリーンショットを参照してください。
     
これで、以下のスクリーンショットに示すように、指定したサフィックスまたはプレフィックスが選択した各セルに追加されました。


Kutools forExcelを使用してすべてのセルにプレフィックスまたはサフィックスを追加します

Excelの関数とVBAコードに慣れていない可能性があります。 この Add Text の有用性 Kutools for Excel 選択した範囲に接頭辞または接尾辞をすばやく挿入するのに役立ちます。

Kutools for Excel - Excel に必要な 300 以上のツールが詰め込まれています。 クレジット カードは必要なく、全機能を備えた 30 日間の無料トライアルをお楽しみください。 ダウンロード中!

1。 接頭辞または接尾辞を追加するセルを選択し、をクリックします  Kutools > Text > Add Text、スクリーンショットを参照してください:

2。 の中に Add Text ダイアログボックスで、プレフィックスまたはサフィックスを テキスト ボックス、チェックボックス Before first character オプション(プレフィックスを追加するため)または After last character オプション(接尾辞を追加するため)必要に応じて、をクリックします Ok
そして今、指定された接頭辞または接尾辞は、選択された各セルに一度に追加されます。 スクリーンショットを参照してください:


デモ:Kutools forExcelを使用して複数のセルにプレフィックスまたはサフィックスを追加する


Kutools for Excel: 300 を超える便利なツールをすぐに利用できます。 機能制限なしの 30 日間の無料トライアルを今すぐ始めてください。 今すぐダウンロード!

Excelのセルの先頭/右側/末尾から接頭辞または接尾辞(同じ文字数)を削除します

Kutools for Excel's Remove By Position この機能により、セル内のテキスト文字列の開始/終了/指定された位置からプレフィックスまたはサフィックス(特定の文字数)を簡単に削除できます。


広告はプレフィックスサフィックスを削除します

関連記事

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

🤖 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 (24)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
hey,
I am doing product coding for some jeweler products but i dont know excel so much, i would like to ask a question to you with an example
like if i have any hoop earring so for earring my code id "E" and for hoop my code is "HP" and "23" for year in which design was made and "09" for the month in which the design was made and "001" for the sequence no of the design made in that month. i want to code it like "EHP2309001". could you please tell me a formula for that or do i need to prepare a different chart for it to use it with V lookup?
This comment was minimized by the moderator on the site
I have Product code which start from 1 to 99 but i want to add prefix that the product code should start from 0001 and end at 0099.
This comment was minimized by the moderator on the site
Hi, you can simply change the cell format for these cells by selecting them and pressing Ctrl + 1, and then selecting Custom on the Number tab, and typing "0000" in the Type: textbox.
This comment was minimized by the moderator on the site
asfdasdfawfe
This comment was minimized by the moderator on the site
How do I prefix a letter to a date in the format "Cmmddyy".

Example. A1 contains date in format mm/dd/yy (let's say 01/31/18)

I want A2 to show "C013118".
This comment was minimized by the moderator on the site
Use this formula in A2:
=IF(A1<>"","C"&IF(MONTH(A1)>=10,MONTH(A1),"0"&MONTH(A1))&DAY(A1)&RIGHT(YEAR(A1),2),"")
This comment was minimized by the moderator on the site
Hi, does any one how to add two numbers in one cell. For example, X 2.2 3.6 0.9 1.2 and I want to add each number with its rank, Like; X 2.2 (2) 3.6 (1) 0.9 (4) 1.2 (3) and these rank must be bold and with different colour.
This comment was minimized by the moderator on the site
thanks very much for KUTOOLS FOR EXCEL
This comment was minimized by the moderator on the site
I have filtered the cloumn and i have to apply TC001 till TC0209 on the filtered cells, could anyone please help me with this
This comment was minimized by the moderator on the site
i have single alphabets in different cell, say 10 cell with different....how can add these alphabets in one cell i.e. total no. of alphabets in one cell
This comment was minimized by the moderator on the site
arihhurthj hshsjsyshsj shshydjdj shshssj shshdj shshjddj Please tell me how to add new line with character GO after every line.
This comment was minimized by the moderator on the site
Need Help, I want to add character in Excell Example Cell No A1 Show A so next cell A2 show B I want to show B in next 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