Adding Text

B

Brent

I have a whole page of different names and I need to add the same two letter
prefix to the beginning of each of them?
 
G

Gary''s Student

First change the xx in the following macro to your prefix.
Then select the cells you want to modify
Then run the macro


Sub prefixx()
For Each r In Selection
r.Value = "xx" & r.Value
Next
End Sub
 
S

Sean Timmons

in a blank column, =prefix&first cell

so, assume the prefix is Mr

="Mr"&A2

copy down and across

Highlight your results and copy, then paste special/values
 
P

Peo Sjoblom

Assume the names are in column A starting in A2, make sure column B is empty
or insert a new column B,
in B2 put


="XY"&A2

or if you want a space between


="XY"&" "&A2


replace XY with your prefix

and copy down as long as needed. Then select the help column, copy it, paste
special as values over the old
and delete the help column

--


Regards,


Peo Sjoblom
 
P

Pete_UK

If the names are in column A, then you can use a formula like this in
a helper column:

="xy"&A1

and copy this down as required. Then you can fix the values in the
helper column by highlighting all the cells with the formula in,
clicking <copy>, then Edit | Paste Special | Values (check) | OK then
<Esc>. Then you can copy/paste these over the originals in column A
and then delete the helper column.

Hope this helps.

Pete
 
Top