Thread: Truncate
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default Truncate

Try substituting "c" for "ActiveCell".

--

Vasant

"Steven" wrote in message
...
Hello
Im trying to pices together code from here that will truncate the text to

the left of and including "/".
This is what I have so far but it isnt working.

Sub Truncate

Dim rng As Range
Dim c As Range
Set rng = Selection
For Each c In rng
c.Value = Left(ActiveCell.Value, InStr(1, ActiveCell.Value, "/") -

1)
Next
End Sub

All help is greatly appreciated.
Steven