Edit text in a cell using VBA

Microsoft Excel home and student 2010 so...
December 14, 2010 at 12:36:42
Specs: Windows 7
I have downloaded a list and I would like to enter the cell and delete the first three characters of each cell without having to do it manually. I would then create a second function to delete the first four spaces for the two digit number, 5 spaces 3 digit numbers etc.

Any help would be greatly appreciated.

1. blue
2. green
3. orange
11. grey


See More: Edit text in a cell using VBA

Report •

December 14, 2010 at 12:49:12
I'm not sure why you need 2 functions.

Based on your examples, this formula should get you the results you are looking for.

e.g. if A1 contains:

1. blue

This will return:


=RIGHT(A1, LEN(A1) - FIND(".",A1) - 1)

Just drag it down alongside your list, then do a Copy...PasteSpecial Values to replace the formulas with text.

Note: If there are extra spaces in the cell, you might have to adjust the "-1" to compensate.

Posting Tip: Before posting Data or VBA Code, read this How-To.

Report •
Related Solutions

Ask Question