Adding double quotes around entries in a column

  • Thread starter Thread starter NCdesigner
  • Start date Start date
N

NCdesigner

I need to add double quotes at the beginning and end of all entries in a very
long column. How can I do this without typing manually?
 
Hi,
Let's say the column is A, in B enter this formula
=""" &A1& """
if this was helpful click yes
 
In next column, use formula =""""&A1&"""" and copy it down the column by
double clicking the fill handle (small sold square in lower right corner of
active cell)

If you wish you could select and copy all of the results; then with the
range still selected use Edit | Paste Special with Values specified. This
converts formulas to values and allows you to delete the original data
best wishes
 
If you want minimal typing and no formulas to clean up....................

Sub Add_Text_Left_Right()
Dim Cell As Range
Dim moretext As String
Dim thisrng As Range
On Error GoTo endit
Set thisrng = Range(ActiveCell.Address & "," & Selection.Address) _
.SpecialCells(xlCellTypeConstants, xlTextValues)
moretext = InputBox("Enter your Text")
For Each Cell In thisrng
Cell.Value = moretext & Cell.Value & moretext
Next
Exit Sub
endit:
MsgBox "only formulas or numbers in range"
End Sub

Select the column.....................Enter " in the Inputbox.


Gord Dibben MS Excel MVP
 
Back
Top