Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
It used to be that you could record a macro and it would replicate the
actions you did while recording i.e. open cell, backspace four times, return - and the result would be that you would eliminate the last four charecters in each of the cells where you ran the macro. This does not seem to be the case any longer since Excel now uses VB. I would appreciate advice on the entries to make in VB to accomplish eliminating the last four charecters of a cells contents. Many Thanks! |
#2
![]() |
|||
|
|||
![]()
One way,
Sub RemoveLastFour() n = ActiveCell.Value r = Len(ActiveCell) - 4 ActiveCell = Left(n, r) End Sub Regards, Paul "Matt" wrote in message ... It used to be that you could record a macro and it would replicate the actions you did while recording i.e. open cell, backspace four times, return - and the result would be that you would eliminate the last four charecters in each of the cells where you ran the macro. This does not seem to be the case any longer since Excel now uses VB. I would appreciate advice on the entries to make in VB to accomplish eliminating the last four charecters of a cells contents. Many Thanks! |
#3
![]() |
|||
|
|||
![]()
Or, for a selected range:
Sub RemoveLastFourFromAll() Dim cl as Range 'Stop screen flashing Application.Screenupdating = False 'Remove last 4 characters For Each cl in Selection cl.value = Left(cl.value,Len(cl.value)-4)) Next cl Application.Screenupdating = True End Sub This will work on all cells within the selected area -- Ken Puls www.officearticles.com "PCLIVE" wrote in message ... One way, Sub RemoveLastFour() n = ActiveCell.Value r = Len(ActiveCell) - 4 ActiveCell = Left(n, r) End Sub Regards, Paul "Matt" wrote in message ... It used to be that you could record a macro and it would replicate the actions you did while recording i.e. open cell, backspace four times, return - and the result would be that you would eliminate the last four charecters in each of the cells where you ran the macro. This does not seem to be the case any longer since Excel now uses VB. I would appreciate advice on the entries to make in VB to accomplish eliminating the last four charecters of a cells contents. Many Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can T Get Macro To Run! | New Users to Excel | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Help with macro looping and color query function | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) |