Add the same character(s) to multiple cells in a column (or row) .

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to add the suffix "scc" into the contiguous cells of several columns
on an existing Excel spreadsheet. There is existing data (alpha/numeric) in
each of the cells already, so the scc suffix would be added to the right of
the existing entries. I'm trying to avoid having to enter each suffix into
each cell individually. I have Excel 2002 and Windows XP Professional.
Thank you.
 
Use a help formula

=Sheet1!A1&"scc"

copy down/across, then copy and paste special as values in place ,
finally replace the old values with the new

Regards,

Peo Sjoblom
 
you can also format the cell and add the text around the number so the value
stays a number vs text by added a text string.
 
Select the range and run:

Sub AddSuffix()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In Selection
With cell
If Not .HasFormula Then
.Value = .Value & "scc"
End If
End With
Next
Application.ScreenUpdating = True
End Sub
 
And to give you more options like a choice of text and left or right addition

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


Gord Dibben Excel MVP
 
Hello Gordon,

I am trying to add LDM- To column which has exsisting data

CELE-315 SHOULD BECOME LDM-CELE-320BX
CELE-315BX SHOULD BECOME LDM-CELE-315BX

PLEASE ADVISE,

BOB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top