LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loop through rows using a wildcard.


Hey all, as you can see I'm using multiple ifs here to quality deleting
a row. However, the case and spelling may be inconsistent. I would
prefer to use a wildcard to capture the values for "cashiering" and not
be limited to upper case. How would I go about this? Thanks in advance
for the expertise!

'***********Begin Code****************
Dim i As Long, beginRow As Long, lastRow As Long
myNum = Application.InputBox( _
prompt:="Please select the beginning row")

beginRow = myNum
lastRow = Cells(Rows.Count, 1).End(xlUp).Row

For i = lastRow To beginRow Step -1
If Cells(i, 1).Value < "BANKRUPTCY" Then
If Cells(i, 1).Value < "CASHIERING/BANK RESEARCH" Then
If Cells(i, 1).Value < "CASHIERING" Then
If Cells(i, 1).Value < "CASHIERING/WESTERN UNION" Then
If Cells(i, 1).Value < "CASHIERING-SPEEDPAY" Then
If Cells(i, 1).Value < "CASHIERING/NORTHBROOK" Then
If Cells(i, 1).Value < "CASHIERING/WIRES" Then
If Cells(i, 1).Value < "CASHIERING/Acq. WIRES" Then
Rows(i).Delete
End If
End If
End If
End If
End If
End If
End If
End If
Next i

'**************End Code************

Regards!


--
mthomas
------------------------------------------------------------------------
mthomas's Profile: http://www.excelforum.com/member.php...o&userid=25649
View this thread: http://www.excelforum.com/showthread...hreadid=392734

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Rows using If and Wildcard Max2073 Excel Worksheet Functions 2 March 16th 10 03:24 PM
Delete Rows using Wildcard Max2073 Excel Worksheet Functions 2 March 16th 10 02:53 PM
Searching Multiple rows using VLOOKUP with wildcard(*,?) lookup va Tommy Excel Worksheet Functions 3 July 11th 08 01:44 AM
loop to insert rows wa_hawks Excel Programming 1 October 16th 04 09:43 PM
Cannot loop through rows in C# Howard Excel Programming 2 February 5th 04 03:39 PM


All times are GMT +1. The time now is 06:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"