You are here:

Excel/Loop Through A String


I would like to loop through a string in a cell and change the letter "A" to the Number "3".
Can this be done with a macro?


Hi Jim,

You can use the Find replace function.
Select the cell and hit the Keys Ctrl & H to open the Find Replace Dialog Box.
Place A in the find box and 3 in the replace box. Then hit replace.

You can use code as well.

   Range("A1").Replace What:="a", Replacement:="3", LookAt:=xlPart, _
       SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Dave Morrison


I can answer most excel questions My Website is


I have been working with spreadsheets since 1991. I am a self-trained excel developer since 2005.

My website

Business admin. U of R.

Awards and Honors
Microsoft Excel MVP 2011-2012

©2017 All rights reserved.