Concatenation

  • Thread starter Thread starter Biff
  • Start date Start date
B

Biff

Hi Folks!

Trying to figure out how to concatenate a string to each cell in a range of
cells.

I tried this:

Selection.Value = ""123"" & Selection.Value

Of course that did not work!

I guess VBA concatenation is different from worksheet concatenation.

Thanks!

Biff
 
I removed one set of "" and it works if I select a single cell but I want to
do this for a range of cells.

Instead of doing this:

="123"&A1

copy down, then copy>paste special>values, then drag to column A.

Thanks!

Biff
 
Dim cell As Range
For Each cell In Selection
cell.Value = "123" & cell.Value
Next cell


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Thanks, Bob!

Biff

Bob Phillips said:
Dim cell As Range
For Each cell In Selection
cell.Value = "123" & cell.Value
Next cell


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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