Concatenate

  • Thread starter Thread starter rickm50
  • Start date Start date
R

rickm50

Am trying to cancatenate one column in Excel. It has +950
rows, want to add "RS8" to each cell value, cell value is
text like "-009" (4 charactors only), so each cell value
will become RS8 + Cell.Value ("RS8-009")
Thanks in advance.
Rick
 
This is one way that it will work for you. Im sure there are many others
with another solution.

Sub test3()
Dim rng As Range
Dim val As String
Dim addval As String

Set rng = Range("B2:B1000") 'set the range of cells to be affected
addval = "RS8" 'initialize the text to add to the start of the
contents
For Each cl In rng ' cycle through the cells
val = addval & cl.Value ' add the value to the beginning of the
cell contents
cl.Value = val 'place the new value as the value of the cell
Next cl

End Sub

HTH
Terry
 
Terry
THANKS for reply. I'll give this a try.
I think I see how that works thanks to your input.
Rick
 

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