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
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
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks