Adding a prefix

C

Chris

Is it possilbe to a prefix to a column of cells? For example the cell now contains "1234" and I would like to change it to read "ABC 1234". I'm looking for a way other than editing each cell one at a time

Thanks
 
J

Jason Morin

Assuming your data is in column A, you could use this
formula in an adjacent column:

="ABC "&A1

and fill down. Then copy this column and paste special >
values over the original column.

HTH
Jason
Atlanta, GA
-----Original Message-----
Is it possilbe to a prefix to a column of cells? For
example the cell now contains "1234" and I would like to
change it to read "ABC 1234". I'm looking for a way other
than editing each cell one at a time.
 
G

Gord Dibben

Sub Add_Text_Left()
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
Next
Exit Sub
endit:
MsgBox "only formulas in range"
End Sub

Gord Dibben Excel MVP
 
D

Dave Peterson

If all your data is numeric, you could even use a custom format. It won't
change the value (they'll remain 1234), but they'll look pretty in the
worksheet:

"abcd "General
or
"abcd "0.00
 
Top