+ Reply to Thread
Results 1 to 14 of 14

Macro to search spreadsheet

  1. #1
    Registered User
    Join Date
    08-17-2012
    Location
    Somerset
    MS-Off Ver
    Excel 2003
    Posts
    8

    Macro to search spreadsheet

    Hello

    I'm looking to make a spreadsheet at work to help myself out.....I'll try and make this as clear as I can! Firstly, I'm using excel 2003....

    On the spreadsheet, I currently have a list of about 300 lines which are names of schools. What I'd like to do is create a command button with a macro behind it where I can put a school name in a text box, and the macro checks to see if the school is on my list or not

    Is that possible? I did macros on excel briefly in school years ago but can't really remember much about it.

    Thanks to anyone that takes the time to help

    David.
    Last edited by Hawken88; 08-20-2012 at 10:17 AM.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Help if a macro exists

    yes, but wouldn't it be easier to use a formula?

  3. #3
    Registered User
    Join Date
    08-17-2012
    Location
    Somerset
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Help if a macro exists

    I don't know really....I've never done anything with formulas....

    ---------- Post added at 03:10 PM ---------- Previous post was at 03:09 PM ----------

    hold on....do you mean things like =sum blah blah blah?

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Help if a macro exists

    hi David, please check attachment
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-17-2012
    Location
    Somerset
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to search spreadsheet

    Hi Guys,

    Having a look at the spreadsheet attached, it's really good. Is there any way for it to check if a cell contains part of the text, rather than matching it exactly? At the moment, the formula is =IF(ISBLANK(D3),"",IF(COUNTIF($A$1:$A$24,D3)>0,"PROCESS","DO NOT PROCESS"))

    That way, I'm hoping to rule out any user error, for example if someone can't spell the name correctly.

    Finally, the last thing I'm going to do is add each school's individual customer number next to them - is there a way for the spreadsheet to show that as well? So for example, in field B1 it will have the customer number for the school in field A1....

    Hope that's clear!

    Thanks for all you guys help, so glad I stumbled across this forum.

    David.

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to search spreadsheet

    hi David, do you mean sort of this?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-17-2012
    Location
    Somerset
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to search spreadsheet

    You're a genius, yes! That's exactly what I'm after.

    Once I add the customer numbers, will there be a way of making that list of results display each cells relevant customer number? I've re-attached and added a couple of generic customer numbers.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to search spreadsheet

    please check attachment
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-17-2012
    Location
    Somerset
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to search spreadsheet

    Man....amazing. That's awesome

    How many cells will that cover? I'm anticipating about 500 schools being on this list by the time I've finished.

    Thanks again Watersev - Huge appreciation for you

  10. #10
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to search spreadsheet

    it will cover 500 and over easily

  11. #11
    Registered User
    Join Date
    08-17-2012
    Location
    Somerset
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to search spreadsheet

    Fantastic, thanks so much

  12. #12
    Registered User
    Join Date
    08-17-2012
    Location
    Somerset
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to search spreadsheet

    Hi guys

    Ok, I have all the data in there that I need. One last thing - when I search, the results don't clear if I do a new search. Any idea how to fix this?

    For example, if you first search for Bishop and get the results, then search for Bruton, you can see below the result for Bruton that the previous numbers don't disappear...

    Schools(1).xls

  13. #13
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to search spreadsheet

    please check attachment
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    08-17-2012
    Location
    Somerset
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to search spreadsheet

    Watersev for President.

    Thanks again :D

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.6.0 RC 1