Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Remove Trailing Comma

Good Afternoon-

I am writing a long macro and having a problem with one thing- after
concatenating a lot of different text values, and separating them by commas,
I have found that some of the composite values have trailing commas at the
end. I am having trouble writing something that will say;

In this range, if a cell ends in a comma, delete the comma. (but leave all
other commas in the range intact)

Could anyone direct me to a resource? Thank you.

Katie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Remove Trailing Comma

For Each cell In Selection
If Right(cell.Value, 1) = "," Then
cell.Value = Left(cell.Value, Len(cell.Value) - 1)
End If
Next

Regards

Trevor


"Katie" wrote in message
...
Good Afternoon-

I am writing a long macro and having a problem with one thing- after
concatenating a lot of different text values, and separating them by
commas,
I have found that some of the composite values have trailing commas at the
end. I am having trouble writing something that will say;

In this range, if a cell ends in a comma, delete the comma. (but leave all
other commas in the range intact)

Could anyone direct me to a resource? Thank you.

Katie



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
How do you remove trailing spaces withour Trim function? RajenRajput1 Excel Discussion (Misc queries) 8 July 27th 09 05:16 PM
Remove Trailing Apostrophe Dave P Excel Discussion (Misc queries) 1 August 10th 07 12:42 AM
Excel 2002 : How to remove trailing spaces ? Mr. Low Excel Discussion (Misc queries) 4 April 6th 07 04:26 PM
remove trailing spaces les8 Excel Discussion (Misc queries) 4 January 20th 06 03:55 PM
how do I remove empty spaces trailing a text string? Need_Help Excel Worksheet Functions 2 June 7th 05 12:13 AM


All times are GMT +1. The time now is 09:50 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"