ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Concatenation (https://www.excelbanter.com/excel-programming/355640-concatenation.html)

Biff

Concatenation
 
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



Niek Otten

Concatenation
 
Using " instead of "" it works fine for me

--
Kind regards,

Niek Otten

"Biff" wrote in message
...
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




Nigel

Concatenation
 
try....

Selection.Value = "123" & Selection.Value


--
Cheers
Nigel



"Biff" wrote in message
...
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





Biff

Concatenation
 
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 copypaste specialvalues, then drag to column A.

Thanks!

Biff

"Niek Otten" wrote in message
...
Using " instead of "" it works fine for me

--
Kind regards,

Niek Otten

"Biff" wrote in message
...
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






Bob Phillips[_6_]

Concatenation
 
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)

"Biff" wrote in message
...
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 copypaste specialvalues, then drag to column A.

Thanks!

Biff

"Niek Otten" wrote in message
...
Using " instead of "" it works fine for me

--
Kind regards,

Niek Otten

"Biff" wrote in message
...
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








Biff

Concatenation
 
Thanks, Bob!

Biff

"Bob Phillips" wrote in message
...
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)

"Biff" wrote in message
...
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 copypaste specialvalues, then drag to column A.

Thanks!

Biff

"Niek Otten" wrote in message
...
Using " instead of "" it works fine for me

--
Kind regards,

Niek Otten

"Biff" wrote in message
...
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











All times are GMT +1. The time now is 10:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com