Cell will number and text

outlawspeeder

Board Regular
Joined
Jan 17, 2009
Messages
225
Office Version
  1. 2019
I looking for a VBA way to pull and replace cells that have both text and numbers. I nee to do math with the numbers and put it back in to the cell. Not all the Cells have Text. The ones without text, there is no need for math.

123 xyz ----->123*2--------->246
234----------------------------->234
2-------------------------------->2
24xyz---------->24*2---------->28
8809 abc----->8809*2------->17618

Thanks
 
so you have Power Query build-in

this (and 2013) require Power Query add-in
the rest doesn't support PQ



why? you can use .xlsm extension


Add ins are blocked. When I go to the "COM Add-in" under options the selections are grayed out. Policy from those that do not understand that these are helpful tools.
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
2019, 365, 2016
so you have Power Query build-in

Power Query aka Get&Transform
GTPQ.png
 
Upvote 0
Rick
If Cell.Value Like "*[!0-9]*" Then

"*[!0-9]*" What is this?

The rest I follow
Like is an operator and compares what is on its left with a pattern string on its right. You can look the Like Operator up in the help files to see all of the possibilities, but to answer your direct question everything inside and including the square brackets represents a single character in the pattern string... this particular character is any not digit character. So, the expressions is testing the text in the cell being examined to see if it contains any non-digit characters.
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

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