#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Concatenate

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

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


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Concatenate

Terry
THANKS for reply. I'll give this a try.
I think I see how that works thanks to your input.
Rick
-----Original Message-----
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


"

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



.

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
concatenate rpmani Excel Worksheet Functions 2 April 16th 10 06:06 PM
CONCATENATE Tservo Excel Worksheet Functions 3 April 16th 10 02:54 AM
Concatenate SJT Excel Discussion (Misc queries) 7 February 19th 10 12:26 AM
concatenate Dave Breitenbach Excel Worksheet Functions 4 January 31st 06 05:56 PM
I know how to concatenate ,can one de-concatenate to split date? QUICK BOOKS PROBLEM- New Users to Excel 1 July 26th 05 05:07 PM


All times are GMT +1. The time now is 11:58 PM.

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

About Us

"It's about Microsoft Excel"