Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default unwanted concatenation

Need to delete appended character string from valid data
in cells in one column (B), so B2:B500. Data in the cells
is of varying length, but the unwanted appended char
string is always 14 characters (including the preceding
<space). In the following example, I want to delete
everything following "Smith John". Characters vary within
the parenthesis, but always this format.

Example:
Smith John (x_cc24_g011)

Is there a way to delete the unwanted string by counting
from the right? Or, by copying the data to the left of
this string to another column?

Thanks for your help,
Randy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default unwanted concatenation

Try this Randy

Sub test()
Dim cell As Range
For Each cell In Range("B2:b500").SpecialCells(xlCellTypeConstants)
On Error Resume Next
cell.Value = Left(cell.Value, Len(cell.Value) - 14)
On Error GoTo 0
Next
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Randy" wrote in message ...
Need to delete appended character string from valid data
in cells in one column (B), so B2:B500. Data in the cells
is of varying length, but the unwanted appended char
string is always 14 characters (including the preceding
<space). In the following example, I want to delete
everything following "Smith John". Characters vary within
the parenthesis, but always this format.

Example:
Smith John (x_cc24_g011)

Is there a way to delete the unwanted string by counting
from the right? Or, by copying the data to the left of
this string to another column?

Thanks for your help,
Randy



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default unwanted concatenation

Much thanks Ron! Works beautifully.

Randy

-----Original Message-----
Try this Randy

Sub test()
Dim cell As Range
For Each cell In Range("B2:b500").SpecialCells

(xlCellTypeConstants)
On Error Resume Next
cell.Value = Left(cell.Value, Len(cell.Value) - 14)
On Error GoTo 0
Next
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Randy" wrote in

message ...
Need to delete appended character string from valid data
in cells in one column (B), so B2:B500. Data in the

cells
is of varying length, but the unwanted appended char
string is always 14 characters (including the preceding
<space). In the following example, I want to delete
everything following "Smith John". Characters vary

within
the parenthesis, but always this format.

Example:
Smith John (x_cc24_g011)

Is there a way to delete the unwanted string by counting
from the right? Or, by copying the data to the left of
this string to another column?

Thanks for your help,
Randy



.

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 help Naresh Excel Worksheet Functions 4 September 30th 09 12:50 AM
Concatenation M Thompson Excel Discussion (Misc queries) 5 May 17th 09 11:16 AM
concatenation Charles Eaves New Users to Excel 1 April 4th 09 04:16 PM
Help with Concatenation alex Excel Worksheet Functions 3 August 28th 07 06:09 PM
concatenation mattguerilla Excel Discussion (Misc queries) 3 January 26th 06 11:47 PM


All times are GMT +1. The time now is 03:43 AM.

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"