?
Solved

Excel Search

Posted on 2006-07-12
1
Medium Priority
?
166 Views
Last Modified: 2012-05-05
Hey...quick question guys!

I have created a macro to seach through a long list of data looking for the key word "*Delisted*".  This macro works great, but now I want it to also look for "*Delisted*" or "*=*".  Thus my goal is to have it find eithier of these two words.  Attached is the code I have currently...

Thanks! Sorry if this is an easy question...I'm still learning VBA

CWJ

-------------------------------------

Sub Copy_Delisted_Tickers()
Dim wb As Workbook, ws As Worksheet, ws_d As Worksheet, rng As Range, cel As Range

Set wb = ActiveWorkbook
Set ws = Worksheets("Reuters Data Check Tool")
Set rng = Intersect(ws.Columns("G"), ws.UsedRange) ' change to 'Description' column
Set ws_d = Worksheets("Delisted Report")

ws.Columns("B").Copy
ws.Columns("G").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone

Sheets("Delisted Report").Select
Range("A2:A1000").Select
Selection.ClearContents

'ws_d.UsedRange.Offset(1).ClearContents

Set ws = ActiveSheet
For Each cel In rng
     If Not IsEmpty(cel) And Not IsError(cel) Then
        If cel.Value Like "*=*" Then
            cel.Offset(0, -6).Copy
            ws_d.Range("A65536").End(xlUp).Offset(1).PasteSpecial xlAll
        End If
    End If
Next cel

ws_d.Move Before:=Sheets(4)
wb.Worksheets("ADR Report").Move Before:=Sheets(4)
ws_d.Tab.ColorIndex = 5

Sheets("Reuters Data Check Tool").Select
Range("D2").Select
Selection.Copy
Sheets("Info").Select
Range("H13").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
Range("H14").Select

Application.DisplayAlerts = True

Call Recalc_FactSet_Data

End Sub
---------------------------
0
Comment
Question by:Craig_W_Johnson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 26

Accepted Solution

by:
EDDYKT earned 2000 total points
ID: 17091561
this line

If cel.Value Like "*=*" Then

to

If cel.Value Like "*=*" or cel.Value Like "*Delisted*" Then
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question