+ Reply to Thread
Results 1 to 9 of 9

Colourful Message Boxes When They Return Search Results.

  1. #1
    Registered User
    Join Date
    09-26-2007
    Posts
    32

    Colourful Message Boxes When They Return Search Results.

    I have created this macro to search for friendly and enemy clans in a game. (There are hundreds, but I have only put 4 in for testing purposes).

    The macro works fine, but I'd like the message boxes to be coloured, red for enemy green for friendly for instance.

    I have absolutely no idea how to go about it. Can anyone help?

    Briefly the macro is in search sheet, and data is in hidden sheet called clans. I have done that so that it can't be edited by users. I unlock and relock within the code.

    I protected the search sheet, but can't remember if I unlocked it - so if you need to log in the password in BBC. This is temporary, I will do something more permanent when finished.

    Thanks

    Kev
    Attached Files Attached Files

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: I need colourful Message Boxes When They Return Search Results.

    Can't be done with a MsgBox but is possible with a small Userform.
    Attached Files Attached Files
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    09-26-2007
    Posts
    32

    Re: I need colourful Message Boxes When They Return Search Results.

    Thank you for that Bakerman, I have sent you rep.

    Could I ask a further couple of questions.

    Firstly security. How do I prevent people from being able to access the code, but able to run the macro? Also at the moment when you start the sheet it asks do you want to switch it on. Can that be overuled and it be available from opening the file?

    Secondly I would like to share the file via google or another share system. I just tried and it doesn't show the macro button. Any ideas how I can share the file after sorting security?

    Thanks.

    Kev

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: I need colourful Message Boxes When They Return Search Results.

    Firstly security. How do I prevent people from being able to access the code, but able to run the macro?
    To protect your code, open the Excel Workbook and go to Tools>Macro>Visual Basic Editor (Alt+F11). Now, from within the VBE go to Tools>VBAProject Properties and then click the Protection page tab and then check "Lock project from viewing" and then enter your password and again to confirm it.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: I need colourful Message Boxes When They Return Search Results.

    Alan has explained to you how to protect your code so for the second part of question 1, this has probably to do with your security settings in TrustCenter regarding the use of macro's.
    Go to Options for Excel >> TrustCenter >> Settings and allow access to Vba Object Model and the use of macro's.

    The second question I sadly have no experience in that area at all so maybe start a new thread regarding that part.

    BTW Thanks for feedback and rep+.

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: I need colourful Message Boxes When They Return Search Results.

    Hello kevb8ll,

    PHP Code: 
    Secondly I would like to share the file via google or another share systemI just tried and it doesn't show the macro button. Any ideas how I can share the file after sorting security? 
    You may try this,
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  7. #7
    Registered User
    Join Date
    09-26-2007
    Posts
    32

    Re: I need colourful Message Boxes When They Return Search Results.

    Thanks for the help guys. The issue is googlesheets, they do not allow VBA. I am now trying to find help of how to convert it to javascript!

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: I need colourful Message Boxes When They Return Search Results.

    Hello kevb8ll,

    Have you tried to send the Workbook as a Zipped file via Google?

    Regards.

  9. #9
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Colourful Message Boxes When They Return Search Results.

    Something attached for Google Script. Though this won't have colourful msgbox. Hmm, I'm sure it's possible, but I don't use Google Script much.
    Attached Files Attached Files
    Last edited by CK76; 04-30-2018 at 12:22 PM.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Return Results from two search columns
    By RHudson714 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-04-2018, 11:40 PM
  2. [SOLVED] Code to search Excel and return results even if part of search text is present
    By Taoyuan00 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2016, 09:20 AM
  3. [SOLVED] Split the results of a search in to 2 list boxes
    By gadrummer65 in forum Excel Programming / VBA / Macros
    Replies: 44
    Last Post: 07-12-2014, 11:20 AM
  4. How to search and return results
    By the deeb in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-09-2011, 05:57 PM
  5. Return search results??
    By itsacatfish in forum Excel General
    Replies: 3
    Last Post: 09-02-2010, 01:33 PM
  6. search tabs and return results
    By korr77 in forum Excel General
    Replies: 14
    Last Post: 02-04-2010, 05:20 AM
  7. VBA, search and return a message
    By hluk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-14-2008, 01:32 PM

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