View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_2449_] Rick Rothstein \(MVP - VB\)[_2449_] is offline
external usenet poster
 
Posts: 1
Default Macro for Removing Characters

This should do what you want...

Sub RemoveLast4Characters()
Dim C As Range
For Each C In Selection
C.Value = Left(C.Value, Len(C.Value) - 4)
Next
End Sub

Rick


"Rob" wrote in message
...
Hello,

I was wondering if there's a way to make a macro or sub that will remove
the
last four characters of the value that is in the cells I select?

I tried to record a macro but when I looked at it in the editor all it did
was have the below...

Range("G4").Select
ActiveCell.FormulaR1C1 = "Test Remove Value "

The value used to read "Test Remove Value Text"


The issue is that the value is a series of random whatever and I want to
be
able to select a bunch of cells all at once and then have it remove just
the
last four characters.


Thanks Very Much In Advance.