Remove all Numbers from list

Excel1991

Board Regular
Joined
Aug 1, 2018
Messages
58
Hi all,

I have a list in excel that looks similar to this:

[TABLE="width: 500"]
<tbody>[TR]
[TD]ROBBY[/TD]
[/TR]
[TR]
[TD]18205[/TD]
[/TR]
[TR]
[TD]19206[/TD]
[/TR]
[TR]
[TD]GEORGE[/TD]
[/TR]
[TR]
[TD]16573[/TD]
[/TR]
[TR]
[TD]ANDERSON[/TD]
[/TR]
[TR]
[TD]23456[/TD]
[/TR]
[TR]
[TD]26752[/TD]
[/TR]
[TR]
[TD]47658[/TD]
[/TR]
</tbody>[/TABLE]

I am trying to get the list so that it looks as follows:
[TABLE="width: 500"]
<tbody>[TR]
[TD]ROBBY[/TD]
[/TR]
[TR]
[TD]ROBBY[/TD]
[/TR]
[TR]
[TD]ROBBY[/TD]
[/TR]
[TR]
[TD]GEORGE[/TD]
[/TR]
[TR]
[TD]GEORGE[/TD]
[/TR]
[TR]
[TD]ANDERSON[/TD]
[/TR]
[TR]
[TD]ANDERSON[/TD]
[/TR]
[TR]
[TD]ANDERSON[/TD]
[/TR]
[TR]
[TD]ANDERSON[/TD]
[/TR]
</tbody>[/TABLE]

I was thinking I could try and remove all the numbers and then do a formula to fill the text down until it reaches the next filled cell. Anyone know how to do this or if there is an easier way? Thanks!
 
Last edited:
Glad to help & thanks for the feedback
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
If the answer to the above question is yes, then try
Code:
Sub Excel1991()
    With Range("A2", Range("A" & Rows.Count).End(xlUp))
        .Value = Evaluate(Replace("if(isnumber(--mid(@,2,1)),"""",@)", "@", .Address))
        .SpecialCells(xlBlanks).FormulaR1C1 = "=r[-1]c"
        .Value = .Value
    End With
End Sub
You can compact your code slightly by putting the R1C1 formula inside the Evaluate function call and removing the SpecialCells code line completely (the Value property can receive a formula value directly)...
Code:
Sub Excel1991()
    With Range("A2", Range("A" & Rows.Count).End(xlUp))
        .Value = Evaluate(Replace("if(isnumber(--mid(@,2,1)),""=r[-1]c"",@)", "@", .Address))
        .Value = .Value
    End With
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top