VBA - A macro to remove part of the data contained in cells

December 2016


I need to remove titles (Mr/Mrs/Miss) preceeding the names in one cell and copy them to another cell. Any idea? Your advice is much appreciated.
  • For example if I have Miss Jane Smith in C2, then in C3: Jane Smith
  • I also need to make the result appear in another sheet.


  • 1) Try this formula

=MID(C2,SEARCH(" ",C2)+1,LEN(C2)-SEARCH(" ",C2)+1)

This will work whatever be the tile in C2 Mr,Mrs or Miss etc. The logic is find the first blank(that is after the title) and use that position in the mid function.

Type in C2
Mr john smith or Miss Gabriel smith
and see what happen in the formula cell
  • 2) You include sheets name before with an exclamation mark.

Suppose Mr john smith is in sheet 1 cell C2

Then in any other sheet and in any empty copy this formula
=MID(Sheet1!C2,SEARCH(" ",Sheet1!C2)+1,LEN(Sheet1!C2)-SEARCH(" ",Sheet1!C2)+1)

Experiment with this formula

Note that

Thanks to venkat1926 for this tip on this forum.

Related :

This document entitled « VBA - A macro to remove part of the data contained in cells » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.