An IF a MID and a isNumeric

kathleen

Active Member
Joined
Dec 16, 2002
Messages
295
I have this text value "6100000"

I am trying to write an if statement to check if the first character of this text string is numeric than to skip it and move on to the next row, no matter what I do I can't get it to work.

Help please
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
63,982
Office Version
  1. 365
Platform
  1. Windows
Are you doing this in VBA?
What is your ultimate goal?
Can you post what you have so far?
 

kathleen

Active Member
Joined
Dec 16, 2002
Messages
295
Thanks I am attempting to do this in vba. I would love to post but I can't get anything but an error.

Thanks again in advance
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
63,982
Office Version
  1. 365
Platform
  1. Windows
You need to give more details on the process. It looks like maybe you want to loop on a specific range. If so what is the range? What do you want it to do if it does NOT find a numeric value?

The more details you give us, the better the answer we can provide for you.
 

kathleen

Active Member
Joined
Dec 16, 2002
Messages
295

ADVERTISEMENT

If the result is not numeric I delete the row. I

I have mixed data that is being evaluated in this loop. I only want to retain the results where the cell is a number. I can handle all the other code, its this statement that is causing me issues.

=ISNUMBER(MID(C15,1,1)) is returning False

Based on the value "6140000" I would assume this statement would return TRUE and in fact is not

Thanks again

Columns("A:A").Select
Range("A1:A5000").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
"AP2"), Unique:=True

Range("AP2").Select
Do While ActiveCell.Value <> ""

' Insert if statement here
' If its numeric skip and move on
' If its text DeleteTheRow


ActiveCell.Offset(1, 0).Select

Loop
 

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
kathleen said:
Thanks I am attempting to do this in vba. I would love to post but I can't get anything but an error.

Thanks again in advance

can you copy your code and paste it here. that would be a help in someone trying to assist
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
63,982
Office Version
  1. 365
Platform
  1. Windows
Try this macro (designed to run on column C):
Code:
Sub MyDelete()

    Dim i As Long
    
    For i = Range("C65536").End(xlUp).Row To 1 Step -1
        If Not IsNumeric(Left(Cells(i, "C"), 1)) Then Rows(i).EntireRow.Delete
    Next i
    
End Sub
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,129
Messages
5,857,542
Members
431,885
Latest member
Rsdg

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
Top