LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default Remove Leading Comma

Sorry Norman, either I didn't see your post or I didn't scroll down far enough.


"Norman Jones" wrote:

Hi Katie,

Try:

'=============
Public Sub Tester()
Dim Rng As Range
Dim rCell As Range

Set Rng = ActiveSheet.Range("I3:I10")

For Each rCell In Rng.Cells
With rCell
If Left(.Value, 1) = "," Then
.Value = Mid(.Value, 2)
End If
End With
Next rCell
End Sub
'<<=============


---
Regards,
Norman



"Katie" wrote in message
...
Hello all- I know that we spoke before about removing a trailing comma, so
i
tried to amend that code to remove a leading comma from a range, but it's
not
working in cells where there's anything after the comma. Could anyone
point
out what I did wrong with this code?

Range("I3:I10").Select
For Each cell In Selection
If Left(cell.Value, 1) = "," Then
cell.Value = Left(cell.Value, Len(cell.Value) - 1)
End If
Next




 
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 to remove first comma in a value JohnBlack Excel Discussion (Misc queries) 8 June 8th 09 10:40 AM
Remove comma tool bar button GKW in GA Excel Discussion (Misc queries) 2 March 22nd 08 04:55 AM
Remove Trailing Comma Katie Excel Programming 1 April 20th 07 11:53 PM
need to remove a comma from end of test in cells Jerry Kinder Excel Worksheet Functions 4 December 14th 05 01:25 AM
How to remove comma and decimals from a value Send Object Command - Two attachments Excel Discussion (Misc queries) 2 November 10th 05 11:13 PM


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