Link to home
Create AccountLog in
Avatar of PeterWhitts
PeterWhittsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Deleting text after a number with vba

I am using Excel 2003

I am looking for vba code that will look at a cell and delete all spaces and text after the first occuring string of numbers (this could be any random numbers 100.00 or 10,000 or 0.00 or 0  with or without a decimal point).

Therefore if the cell has "Marketing Area 234.0 plus any text which may include a randum number like 99" what I need is "Marketing Area 234.0"

Therefore if the cell has "Book Plot 9,234 plus any extra text which may include a randum number  102 for example" what I need is "Book Plot 9,234"

Many thanks
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Place this function in a module
Avatar of PeterWhitts

ASKER

Thanks for that but it doesn't work for "Book Plot 9,234.00 plus any extra text which may include a randum number  102 for example".

You get the whole string
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Many thanks for the joint answer