#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


--
XCESIV
------------------------------------------------------------------------
XCESIV's Profile: http://www.excelforum.com/member.php...o&userid=24271
View this thread: http://www.excelforum.com/showthread...hreadid=546937

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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" wrote in
message ...

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
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
Get Macro warning, but can't find Macro Stilla Excel Worksheet Functions 1 January 20th 07 01:27 AM
change error message when no more for "find" in macro to find swyltm Excel Programming 1 January 13th 06 05:16 PM
I need to find a macro to find data cut and paste to another colu. Rex Excel Programming 6 December 7th 04 09:22 AM
Can't find macro Jim Excel Worksheet Functions 2 December 2nd 04 01:26 PM
Can't find a macro Bob Potts Excel Programming 2 December 10th 03 07:02 PM


All times are GMT +1. The time now is 07:22 AM.

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

About Us

"It's about Microsoft Excel"