[excel] Append same text to every cell in a column in Excel

The answer is


Pretty simple...you could put all of them in a cell using the concatenate function:

=CONCATENATE(A1, ", ", A2, ", ", and so on)

I just wrote this for another answer:

You would call it using the form using your example: appendTextToRange "[theRange]", ",".

Sub testit()
    appendTextToRange "A1:D4000", "hey there"
End Sub


Sub appendTextToRange(rngAddress As String, append As String)

    Dim arr() As Variant, c As Variant
    arr = Range(rngAddress).Formula

    For x = LBound(arr, 1) To UBound(arr, 1)
        For y = LBound(arr, 2) To UBound(arr, 2)
            Debug.Print arr(x, y)
            If arr(x, y) = "" Then
                arr(x, y) = append
            ElseIf Left(arr(x, y), 1) = "=" Then
                arr(x, y) = arr(x, y) & " & "" " & append & """"
            Else
                arr(x, y) = arr(x, y) & " " & append
            End If
        Next
    Next
    Range(rngAddress).Formula = arr

End Sub

Select the range of cells, type in the value and press Ctrl + Enter.

This, of course, is true if you want to do it manually.


There is no need to use extra columns or VBA if you only want to add the character for display purposes.

As this post suggests, all you need to do is:

  1. Select the cell(s) you would like to apply the formatting to
  2. Click on the Home tab
  3. Click on Number
  4. Select Custom
  5. In the Type text box, enter your desired formatting by placing the number zero inside whatever characters you want.

Example of such text for formatting:

  • If you want the cell holding value 120.00 to read $120K, type $0K

Put the text/value in the first cell, then copy the cell, mark the whole colum and 'paste' the copied text/value.

This works in Excel 97 - sorry no other version available on my side...


Simplest of them all is to use the "Flash Fill" option under the "Data" tab.

  1. Keep the original input column on the left (say column A) and just add a blank column on the right of it (say column B, this new column will be treated as output).

  2. Just fill in a couple of cells of Column B with actual expected output. In this case:

          [email protected],
          [email protected],
    
  3. Then select the column range where you want the output along with the first couple of cells you filled manually ... then do the magic...click on "Flash Fill".

It basically understands the output pattern corresponding to the input and fills the empty cells.


It's simple...

=CONCATENATE(A1, ",")

Example: if [email protected] is in the A1 cell then write in another cell: =CONCATENATE(A1, ",")

[email protected] After this formula you will get [email protected],

For remove formula: copy that cell and use Alt + E + S + V or paste special value.


It's a simple "&" function.

=cell&"yourtexthere"

Example - your cell says Mickey, and you want Mickey Mouse. Mickey is in A2. In B2, type

=A2&" Mouse"

Then, copy and "paste special" for values.

B2 now reads "Mickey Mouse"

Highlight the column and then Ctrl + F.

Find and replace

Find ".com"

Replace ".com, "

And then one for .in

Find and replace

Find ".in"

Replace ".in, "


Type it in one cell, copy that cell, select all the cells you want to fill, and paste.

Alternatively, type it in one cell, select the black square in the bottom-right of that cell, and drag down.