本文介绍了如何从带有函数或正则表达式的单元格中删除所有数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的单元格看起来像这样,每行一个:

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

伊利亚斯(Ignace)莉莲(Lilien),1897-1963年: 歌曲,1920-1935年.安雅·范·维克(Anja van Wijk) 钢琴演奏家Frans van Ruth

Lilien,Ignace 1897-1963: Songs,1920-1935. Anja van Wijk,mezzo & Frans van Ruth,piano

Hindemith,Trauermusik.赛尔,仙女 大号床套房.罗西尼,弦奏鸣曲6. 彼得罗夫(Petrov),《创造世界》芭蕾 套房.巴托克,罗马尼亚民间舞Sz 56.塔尔蒂尼,G.Maiorov列宁格勒古乐团长笛协奏曲 &现代音乐/谢罗夫

Hindemith,Trauermusik. Purcell,'Fairy Queen' Suite. Rossini,String Sonata 6. Petrov,'Creation of the World' Ballet Suite. Bartok,Romanian Folkdances Sz 56. Tartini,Flute Concerto in G w.A.Maiorov Leningrad Orch.for Ancient & Modern Music/ Serov

Bizet,Verdi,Massenet,Puccini:Arias 来自Carmen,Rigoletto,Werther和Manon 莱斯考特(Lescaut),托斯卡(Tosca),图兰朵(Turandot)+歌曲 Lara,Di Capua等.彼德 德沃斯基,男高音布拉迪斯拉发 乐团/莱纳德(Lenard)也表演《卡门》 公开& 泰国人"冥想. Rec.Live,10/87

Bizet,Verdi,Massenet,Puccini: Arias from Carmen,Rigoletto,Werther,Manon Lescaut,Tosca,Turandot + Songs by Lara,Di Capua et al. Peter Dvorsky,tenor w.Bratislava Orch./Lenard Also performing 'Carmen' Overt.& 'Thais' Meditation. Rec.Live,10/87

Fantini,Rauch,C.Straus,Priuli,Bertali: '皇家法院的节日弥撒 1648年,维也纳约克郡巴赫合唱团 巴洛克独奏家+巴洛克式黄铜 伦敦/西摩

Fantini,Rauch,C.Straus,Priuli,Bertali: 'Festival Mass at the Imperial Court of Vienna,1648' Yorkshire Bach Choir & Baroque Soloists + Baroque Brass of London/Seymour

Vinci,Leonardo1690-1730:Arias来自 半酰胺Riconosciuta,Didone Lo,Caduta dei Decemviri,Abbandonata,Lo Cecato Fauzo,La Festa de Bacco,Catone 在尤蒂卡.玛丽亚·安吉利斯·彼得斯(Maria Angeles Peters). 卡拉罗(W.M. Carraro)指挥

Vinci,Leonardo1690-1730: Arias from Semiramide Riconosciuta,Didone Abbandonata,La Caduta dei Decemviri,Lo Cecato Fauzo,La Festa de Bacco,Catone in Utica. Maria Angeles Peters sop. w.M.Carraro conducting

格鲁克,莫扎特,贝多芬,韦伯,威尔第,瓦格纳,庞基埃利,马斯卡尼,普契尼: 顿阿利斯特的阿里亚斯(Arias) 乔凡尼,费德里奥,奥伯龙,巴尔,特里斯坦,步行街,齐格弗里德,哥达丹梅隆,乔康达,卡瓦莱里亚,托斯卡. 海伦·怀德布伦(Helene Wildbrunn).建议1919-24

Gluck,Mozart,Beethoven,Weber,Verdi,Wagner,Ponchielli,Mascagni,Puccini: Arias from Alceste,Don Giovanni,Fidelio,Oberon,Ballo,Tristan,Walkure,Siegfried,Gotterdammerung,Gioconda,Cavalleria,Tosca. Helene Wildbrunn. Rec.1919-24

我想删除所有数字.我该如何使用公式?还是只是搜索并用正则表达式替换?

I would like to remove ALL numbers. how do I do this with a formula? or maybe just search and replace with regex?

推荐答案

如何使用VBA做到这一点...

How to do that using VBA...

  1. 打开一个Excel工作簿,然后粘贴通过以下方式提供的文本:

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

让这些行处于选中状态.

Let those rows selected.

按"ALT + F11"打开Visual Basic编辑器.

Press "ALT+F11" to open the Visual Basic Editor.

转到插入"菜单并打开一个模块.

Go to the Insert Menu and open a Module.

键入此函数:

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

单击绿色的播放"按钮以执行VBA脚本.

Click the green Play button to execute the VBA script.

返回到工作表并查看结果(没有更多数字):

Get back to the sheet and see the result (no more digits):

这篇关于如何从带有函数或正则表达式的单元格中删除所有数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 23:40