Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,688
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,688
Default 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





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,688
Default 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









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenation Vic Excel Discussion (Misc queries) 5 October 22nd 09 05:57 PM
Concatenation help Naresh Excel Worksheet Functions 4 September 30th 09 12:50 AM
Concatenation orquidea Excel Discussion (Misc queries) 6 January 11th 08 07:19 PM
Concatenation Ken Excel Discussion (Misc queries) 1 April 12th 06 11:26 AM
Concatenation Jim Cone Excel Programming 0 October 31st 04 01:17 AM


All times are GMT +1. The time now is 08:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"