#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Wild Card?

I was graciously provided a macro that has the following line:

ArrNames = Array("Agt", "Agent")

Is it possible to add a wildcard to "Agt"? Those are just the first 3
letters of the lines I'm looking for and are followed by more text. None of
the rows are unique and are being deleted as a result of the routine.

I have pasted the provided code below, incase the above makes no sense.

Thank you for your help!!

Ken


Sub Loop_Example()

Dim Firstrow As Long
Dim Lastrow As Long
Dim Lrow As Long
Dim CalcMode As Long
Dim ViewMode As Long
Dim ArrNames As Variant

With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

With ActiveSheet
.Select

ViewMode = ActiveWindow.View
ActiveWindow.View = xlNormalView

.DisplayPageBreaks = False

Firstrow = .UsedRange.Cells(7).Row
Lastrow = .UsedRange.Rows(.UsedRange.Rows.Count).Row

ArrNames = Array(" Agt ID", "Agent Summary")

For Lrow = Lastrow To Firstrow Step -1

With .Cells(Lrow, "A")

If Not IsError(.Value) Then

If IsError(Application.Match(.Value, ArrNames, 0)) Then
..EntireRow.Delete

End If

End With

Next Lrow

End With

ActiveWindow.View = ViewMode
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With

End Sub
Reply
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
Using a wild card in SUMPRODUCT SFC Traver Excel Worksheet Functions 8 February 16th 09 06:11 PM
Wild card * in Array ATL_Gabriel Excel Worksheet Functions 1 January 29th 09 11:32 PM
how to use wild card in if funtion doyree Excel Discussion (Misc queries) 3 February 4th 08 08:39 PM
Wild Card!!!??? Sean Excel Programming 3 August 31st 06 06:55 PM
Wild card * Herman Excel Worksheet Functions 0 October 21st 05 01:39 PM


All times are GMT +1. The time now is 01:02 AM.

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

About Us

"It's about Microsoft Excel"