View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Robin Hammond Robin Hammond is offline
external usenet poster
 
Posts: 79
Default Delete characters in cell

I'm guessing you want something like this.

Sub StripRight()
Dim rngCell As Range
For Each rngCell In Selection
rngCell.Value = Right(rngCell.Value, 6)
Next rngCell
End Sub

Robin Hammond
www.enhanceddatasystems.com


"AuthorizedUserPF" wrote in message
...
Hello

I have a cell containing characters in A1
The Characters are right aligned. I want to delete the righmost 6

characters
in the cell.
I am trying something like

Sub Remove_Characters()
Anystring = Range("a1")
MyStr = Right(Anystring,6)
MyStr Delete
End Sub

It isn't working. Am I using Delete in the correct context?

Thanks
I am running Win XP Pro and Excel Office XP