Delete Text from a cell, but keep the numbers

g_marquez04

New Member
Joined
Jun 13, 2003
Messages
17
Ok guys I have a problem, I have a column that I want only numbers to be entered in. I have created a macro that will
1. Copy and paste the below data into another worsheet,
but I also want for this macro to
2. Delete all letters that are in the column,
3. BUT I want to keep all the numbers.
4. I also want a message box to appear telling the user that there is text in that cell.
5. And I want that row to be highlighted.

I have no clue how to delete the letters from the cell, I may be able to figure out how to highlight the rows, and pop up the message box.
Thanks in advance for the help
Book3
ABCD
1PartNumberQty
2833222
3847623
4885234
58980850
6898461
7898484
88987058
99230218
109230450LF
119230620
12923072
139231020
149231654
159231720LF
1692318H50
1796991F12
1827443350
1928805620
202880571
212891704
Sheet1
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I am not sure about the message part, but here is a user defined function that will pull just the numeric values from any string:

Code:
Function MyNum(MyString) As Single

    Dim i As Integer

    For i = 1 To Len(MyString)
        If IsNumeric(Mid(MyString, i, 1)) Then MyNum = MyNum & Mid(MyString, i, 1)
    Next i

End Function
 
Upvote 0

Forum statistics

Threads
1,216,058
Messages
6,128,538
Members
449,456
Latest member
SammMcCandless

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