+ Reply to Thread
Results 1 to 10 of 10

Make a message appear

  1. #1
    Registered User
    Join Date
    09-28-2008
    Location
    UK
    MS-Off Ver
    MS 365 Apps for Enterprise
    Posts
    64

    Make a message appear

    Hi all,

    I am at a loss to a solution to this thus far (without using comments or validation); what I am trying to do is as follows.

    When I click a cell (say A1) I want a specific message to appear in another cell (say B1); when I click A2, a different message should appear in B1 (basically B1 will be my display zone). The reasons I need it as such are that the sheet is a calendar and so putting all of the messages in would look ridiculous, and I really need a static position (B1) for the messages.

    I look forward to any help I can receive.

    Thanks.

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Make a message appear

    You can use an Event amcro for this. Put the following in the worksheet code area:

    Please Login or Register  to view this content.

    Because it is worksheet code, it is very easy to install and automatic to use:

    1. right-click the tab name near the bottom of the Excel window
    2. select View Code - this brings up a VBE window
    3. paste the stuff in and close the VBE window

    If you have any concerns, first try it on a trial worksheet.

    If you save the workbook, the macro will be saved with it.


    To remove the macro:

    1. bring up the VBE windows as above
    2. clear the code out
    3. close the VBE window

    To learn more about macros in general, see:

    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    To learn more about Event Macros (worksheet code), see:

    http://www.mvps.org/dmcritchie/excel/event.htm


    Macros must be enabled for this to work!
    Last edited by Jakobshavn; 12-08-2012 at 07:44 PM.
    Gary's Student

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Make a message appear

    Slight variation to cover the case if B1 needs to be blanked if a cell in column A is not selected.

    Please Login or Register  to view this content.
    Martin

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Make a message appear

    If you want to populate cell B1 with the value of any cell that is selected on the sheet, you can try this:
    Please Login or Register  to view this content.
    Add it to that worksheets VBA. For instructions how to do that, see Jakobshavn's post above.

    - Moo

  5. #5
    Registered User
    Join Date
    09-28-2008
    Location
    UK
    MS-Off Ver
    MS 365 Apps for Enterprise
    Posts
    64

    Re: Make a message appear

    Thanks for the responses,

    My range of messages will be in a hidden list, how do I amend the VBA to show the entry from the list (apologies for my lack of coding skills).

  6. #6
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Make a message appear

    Reveal the location of the hidden list.

  7. #7
    Registered User
    Join Date
    09-28-2008
    Location
    UK
    MS-Off Ver
    MS 365 Apps for Enterprise
    Posts
    64

    Re: Make a message appear

    Jakobshavn, Thanks for your responses. What I meant was that rather than having the message that appears in B1 defined in the VBA, is it possible to have it taken from another location?

    Basically what I am looking for is this; if A1 is the cell selected then B1 will show the contents of Z1, if A2 is the cell slected then B1 will show the contents of Z2 etc. Essentially I will have a list hidden somewhere that relates to column A, though it would be too much to have this all appearing in the cells of column A at all times (thus just making them appear as required). Is this possible?

    Thanks in avance.

  8. #8
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Make a message appear

    In that case use:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-28-2008
    Location
    UK
    MS-Off Ver
    MS 365 Apps for Enterprise
    Posts
    64

    Re: Make a message appear

    Perfect, thank you for your help!

  10. #10
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Make a message appear

    Thanks for the feedback!

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