View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
jloberg[_2_] jloberg[_2_] is offline
external usenet poster
 
Posts: 1
Default editing cells...


Thanks, Ron! This was the simple solution I was looking for ... sor
of.

Get this: your macro returns [50.234] from ['150.234] .... but when
remove the second cell.Value line in your macro I get a clea
[150.234]. This will work sufficiently.

But I'm curious why the ' is removed.

Thank you for your help.
loberg


*
Sub test()
For Each cell In Selection
On Error Resume Next
cell.Value = Left(cell.Value, Len(cell.Value) - 3)

On Error GoTo 0
Next
End Sub
*



Ron de Bruin wrote:
[b]Try something like this for the selection

Sub test()
For Each cell In Selection
On Error Resume Next
cell.Value = Left(cell.Value, Len(cell.Value) - 3)
cell.Value = Right(cell.Value, Len(cell.Value) - 1)
On Error GoTo 0
Next
End Sub




--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.n


-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com