tried recording a macro to erase the last 10 digits within the active cell
and then go one line down. However, when I tried to use the macro a second
time instead of erasing the the last 10 digits it just copies the previous
active cell to the new one.

This is how the recorded macro came out

as you can see the 1st program line just shows the finished result and not
how it deleted the 10 digit phone # at the end. When utiliizing this macro
again it just places the Tullahoma, TN 37388 in the active cell I'm trying to
correct.

Sub erase10()
'
' erase10 Macro
' Macro recorded 7/22/2008 by Superior Medical
'
' Keyboard Shortcut: Ctrl+e
'
ActiveCell.FormulaR1C1 = "Tullahoma, TN 37388 "
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub

RE: need macro: erase the last 10 digits of active cell then down 1 by Wigi

Wigi
Tue Jul 22 15:49:03 CDT 2008

With ActiveCell
.Value = Left(.Value,len(.value)-10)
.Offset(1).Select
End With



--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"WallyGator" wrote:

> tried recording a macro to erase the last 10 digits within the active cell
> and then go one line down. However, when I tried to use the macro a second
> time instead of erasing the the last 10 digits it just copies the previous
> active cell to the new one.
>
> This is how the recorded macro came out
>
> as you can see the 1st program line just shows the finished result and not
> how it deleted the 10 digit phone # at the end. When utiliizing this macro
> again it just places the Tullahoma, TN 37388 in the active cell I'm trying to
> correct.
>
> Sub erase10()
> '
> ' erase10 Macro
> ' Macro recorded 7/22/2008 by Superior Medical
> '
> ' Keyboard Shortcut: Ctrl+e
> '
> ActiveCell.FormulaR1C1 = "Tullahoma, TN 37388 "
> ActiveCell.Offset(1, 0).Range("A1").Select
> End Sub
>

RE: need macro: erase the last 10 digits of active cell then down by WallyGator

WallyGator
Tue Jul 22 15:57:06 CDT 2008



"Wigi" wrote:

> With ActiveCell
> .Value = Left(.Value,len(.value)-10)
> .Offset(1).Select
> End With
>
>
>
> --
> Wigi
> http://www.wimgielis.be = Excel/VBA, soccer and music
>
>
> "WallyGator" wrote:
>
> > tried recording a macro to erase the last 10 digits within the active cell
> > and then go one line down. However, when I tried to use the macro a second
> > time instead of erasing the the last 10 digits it just copies the previous
> > active cell to the new one.
> >
> > This is how the recorded macro came out
> >
> > as you can see the 1st program line just shows the finished result and not
> > how it deleted the 10 digit phone # at the end. When utiliizing this macro
> > again it just places the Tullahoma, TN 37388 in the active cell I'm trying to
> > correct.
> >
> > Sub erase10()
> > '
> > ' erase10 Macro
> > ' Macro recorded 7/22/2008 by Superior Medical
> > '
> > ' Keyboard Shortcut: Ctrl+e
> > '
> > ActiveCell.FormulaR1C1 = "Tullahoma, TN 37388 "
> > ActiveCell.Offset(1, 0).Range("A1").Select
> > End Sub
> >