How to remove ALL numbers from a cell with a function or regex?

前端 未结 3 1464
你的背包
你的背包 2021-02-10 17:10

I have cells that look like this, one per line:

Duffy,John: \'Heritage: Civilization and the Jews\'- Fanfare & Chorale,Symphonic Dances + Orchestr

3条回答
  •  清酒与你
    2021-02-10 18:11

    How to do that using VBA...

    1. Open an Excel workbook and paste the text you provided this way: alt text

    2. Let those rows selected.

    3. Press “ALT+F11” to open the Visual Basic Editor.

    4. Go to the Insert Menu and open a Module.

    5. Type in this function:

      Sub clear()
      s = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")
      For Each r In Selection
      v = r.Value
      For i = 0 To 9
      v = Replace(v, s(i), "")
      Next
      r.Value = v
      Next
      End Sub
      

    6. Click the green Play button to execute the VBA script. alt text

    7. Get back to the sheet and see the result (no more digits): alt text

提交回复
热议问题