Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 11-05-2015, 11:11 AM
NoSparks NoSparks is offline Need to extract all lines containing EA, EB, EC...EZ. (case sensitive) Windows 7 64bit Need to extract all lines containing EA, EB, EC...EZ. (case sensitive) Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Assuming your data is on sheet1 and
assuming your data starts on row 2 and
assuming your data is in column A and
assuming your data always starts with an upper case letter
(now you know why to post a sample sheet)
something like this should work.
Test it on a copy of your sheet.

Code:
Sub test()
    Dim str As String
    Dim i As Long
    
Application.ScreenUpdating = False
With Sheets("Sheet1")
    For i = .Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
        With Cells(i, 1)
            str = .Value
            If Asc(Mid(str, 2, 1)) < 65 Or Asc(Mid(str, 2, 1)) > 90 Then
                Cells(i, 1).EntireRow.Delete
            End If
        End With
    Next i
End With
Application.ScreenUpdating = True
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why are message header rules are case sensitive delboy Outlook 1 10-10-2023 11:30 AM
Help with Case and Select case brent chadwick Word VBA 34 10-18-2015 02:13 PM
Deleting grid lines but keeping the axis lines CoffeeNut Excel 0 04-01-2013 01:50 PM
Case Sensitive (contains) Selection apolloman Excel 2 07-12-2011 04:50 AM
Need to extract all lines containing EA, EB, EC...EZ. (case sensitive) From all UPPER CASE to Proper Case davers Word 1 04-30-2009 12:41 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft