Hello.
I am new to Excel macro programming in visual basic, and have a macro that I would like to use to make my work a bit easier.
I need to create a macro to search out the following strings of characters in a column:
"MIL-STD"
"J-STD"
"WS"
"0D"
"DWG"
When it finds any of these strings in the column, it would delete the associated row.
Any help on this would be greatly appreciated.
Thank you in advance!
Last edited by rliccion; 08-27-2009 at 11:41 AM. Reason: title fix
Welcome to the forum.
Please take a few minutes to read the forum rules, and then amend your thread title accordingly.
Thanks.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Code:Dim cell_check As Variant Dim range_check As Range Dim nCol As Long Dim rCount As Long With ActiveSheet nCol = Application.Match("Row anem goes here", .Rows(1), 0) For rCount = .UsedRange.Rows.Count To 2 Step -1 Select Case .Cells(rCount, nCol).Value Case = "MIL-STD", "J-STD", "WS", "0D", "DWG" .Rows(rCount).EntireRow.Delete End Select Next End With
Last edited by jseufert; 08-28-2009 at 06:43 PM.
jseufert, please edit your post to add code tags.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks