Back

About MrExcel
Consulting Services
Learn Excel Resources
Challenge of the Month
MrExcel Seminars

Message Board

MrExcel Store
Podcast
Search
Contact
Home

 

 

Past Tip of the Day

 

Lloyd writes: I attempted to use the F2/Edit function in the record macro mode. It would not work. It appears when you are in the F2 mode, record is turned off. Is this true?

What I need to do throughout a big worksheet was to edit the cell, move the cursor to the end of the cell and then delete the last 4 characters if the characters.

This macro should do it:


Sub RemoveLast4()
For Each cell In ActiveSheet.Cells.SpecialCells(xlCellTypeConstants)
cell.Value = Left(cell.Value, Len(cell.Value) - 4)
Next cell
End Sub

By Bill Jelen on 11-Nov-2001

MrExcel.com Consulting can be hired to implement this concept, or many other cool applications, with your data.

MrExcel.com provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures on this web site are provided "as is" and we do not guarantee that they can be used in all situations.

 

Excel is a registered trademark of the Microsoft® Corporation.

All contents Copyright 1998-2008 by MrExcel Consulting.