+ Reply to Thread
Results 1 to 2 of 2

Thread: find macro

  1. #1
    Registered User
    Join Date
    06-13-2005
    Posts
    43

    find macro

    I want to setup a macro that searches for a part of a cell and then brings back the cell/s relevant to the search.

    similar to a v lookup but i dont want to have it on the sheet. I want it only as a question box

    There also may be various accounts on the list with similar Descriptions
    I would like the display box to display all accounts with the matching string

    EG
    account No. 85000 - "WAGES - STAFF"
    account No. 85500 - "WAGES - CONTRACTS"
    account No. 85200 - "SUPERANNUATION"


    Search "Wages"

    Results
    85000 - WAGES - STAFF
    85500 - WAGES - CONTRACTS

  2. #2
    Bob Phillips
    Guest

    Re: find macro

    Sub Test()
    Dim iLastRow As Long
    Dim i As Long
    Dim stmp

    iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
    For i = 1 To iLastRow
    If LCase(Cells(i, "A").Value) Like "*wages*" Then
    stmp = stmp & Cells(i, "A").Value & vbNewLine
    End If
    Next i

    MsgBox stmp

    End Sub


    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "XCESIV" <XCESIV.28nd5y_1149037202.2339@excelforum-nospam.com> wrote in
    message news:XCESIV.28nd5y_1149037202.2339@excelforum-nospam.com...
    >
    > I want to setup a macro that searches for a part of a cell and then
    > brings back the cell/s relevant to the search.
    >
    > similar to a v lookup but i dont want to have it on the sheet. I want
    > it only as a question box
    >
    > There also may be various accounts on the list with similar
    > Descriptions
    > I would like the display box to display all accounts with the matching
    > string
    >
    > EG
    > account No. 85000 - "WAGES - STAFF"
    > account No. 85500 - "WAGES - CONTRACTS"
    > account No. 85200 - "SUPERANNUATION"
    >
    >
    > Search "Wages"
    >
    > Results
    > 85000 - WAGES - STAFF
    > 85500 - WAGES - CONTRACTS
    >
    >
    > --
    > XCESIV
    > ------------------------------------------------------------------------
    > XCESIV's Profile:

    http://www.excelforum.com/member.php...o&userid=24271
    > View this thread: http://www.excelforum.com/showthread...hreadid=546937
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0