Removing everything but numbers from cell

jwdemo

Board Regular
Joined
Dec 12, 2013
Messages
188
Office Version
  1. 2013
I have a worksheet and column B has a list of departments and supplier order numbers in it. I'm wanting to get rid of everything but the numbers.
Some examples in these cells are:

Meat:FZN:Retail Ready:160501
Local Meat:Pork:130517
Local Meat:Beef-SweetGrass:110005
Dairy:Food Service:220017


Is there a way to get this done with a macro or a formula in an adjacent column?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
my dear friend
use
@ and type letter by letter of the name of person

like @jwdemo

anyway that's fine if it works for you
Have a nice day
 
Upvote 0
Try
Code:
Sub Maybe()
With Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row).Offset(, 1)
    .Formula = "= TRIM(RIGHT(SUBSTITUTE(RC[-1],"":"",REPT("" "",LEN(RC[-1]))),LEN(RC[-1])))"
    .Value = .Value
End With
End Sub
 
Upvote 0
Since you only want the last 6 digits, try this...
VBA Code:
Sub SixDigitsAtEnd()
  [A:A].Copy [B1]
  [B:B].Replace "*:", "", xlPart, , , , False, False
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,573
Members
449,089
Latest member
Motoracer88

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