Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub RemoveAlphas() '' Remove alpha characters from a string. Dim intI As Integer Dim rngR As Range, rngRR As Range Dim strNotNum As String, strTemp As String[/color][/color] On Error GoTo Endit Set rngRR = Selection.SpecialCells(xlCellTypeConstants, _ xlTextValues) For Each rngR In rngRR strTemp = "" For intI = 1 To Len(rngR.Value) If Mid(rngR.Value, intI, 1) Like "[0-9]" Then strNotNum = Mid(rngR.Value, intI, 1) Else: strNotNum = "" End If strTemp = strTemp & strNotNum Next intI rngR.Value = strTemp Next rngR Endit: masgbox "Cells contain numbers only" End Sub this macro works good but it's correctly being used in the middle of another macro so everything stops. how can i change the error checker to continue with the macro if the cells contain numbers only? I no longer want the msgbox -- Tha BeatMaker ------------------------------------------------------------------------ Tha BeatMaker's Profile: http://www.excelforum.com/member.php...o&userid=23998 View this thread: http://www.excelforum.com/showthread...hreadid=384113 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error Messages | Excel Worksheet Functions | |||
Name error messages... | Excel Worksheet Functions | |||
error messages | Excel Discussion (Misc queries) | |||
Error Messages | Excel Worksheet Functions | |||
Error Messages | Excel Worksheet Functions |