+ Reply to Thread
Results 1 to 21 of 21

Macro to Create Message box based on cell values

  1. #1
    Registered User
    Join Date
    12-04-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    91

    Macro to Create Message box based on cell values

    Friends,

    I have an excel sheet and on that I am using drop down menu from Cell U8 to U357 (Data Validation). In this work sheet, If I selected "A" from the drop down menu, I want to Display a message box with a message " Please enter the absent mode" and once the user clicked OK on the message box automatically the selection should go to its parallel "V" cell. (If only that cell

    Eg: As soon as I selected "A" in U10, the " Please enter the absent mode" message should appear with an OK button and after clicking the OK the curson should select the "V10" Cell. I will be more happy if only "V10" cell is active and only after entering a value in "V10" then only the user do anything on other cells.

    Kindly help and thanks in advance.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Macro to Create Message box based on cell values

    Copy and paste this code in the Worksheet Module

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-04-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Macro to Create Message box based on cell values

    But Sir, I need the message box to appear only if I I selected the values in between Cell U8 to U357....and how about the selection after clicking the OK button in the message box?

  4. #4
    Registered User
    Join Date
    12-04-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Macro to Create Message box based on cell values

    Quote Originally Posted by davesexcel View Post
    Copy and paste this code in the Worksheet Module

    Please Login or Register  to view this content.



    Sir,

    Thanks

    It is working, But how about going to respective next cell after clicking OK????

  5. #5
    Registered User
    Join Date
    12-04-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Macro to Create Message box based on cell values

    Quote Originally Posted by davesexcel View Post
    Copy and paste this code in the Worksheet Module

    Please Login or Register  to view this content.



    Sir,

    Thanks

    It is working, But how about going to respective next cell after clicking OK????

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Macro to Create Message box based on cell values

    It's already there, the msgbox is redundant, and will eventually be a pain in the butt.
    When "A" is entered in the target range, the next cell is selected.

    Where are the Modules?

    http://www.davesexcel.com/wherearethemodules.htm
    Last edited by davesexcel; 12-16-2013 at 10:03 AM.

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Macro to Create Message box based on cell values

    Look at the example workbook found here to see how to set ranges in the worksheet events.

    Worksheet Events

  8. #8
    Registered User
    Join Date
    12-04-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Macro to Create Message box based on cell values

    Thanks sir,

    But it is not going directly to the respected "V" cell after clicking OK in the message box....

    also how to lock all other activities except entry in respective "V" cell?

    Thanks in advance sir...
    Last edited by aneshdas; 12-17-2013 at 03:30 AM.

  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Macro to Create Message box based on cell values

    If you select "A" from the dropdown, the cell next to it is automatically selected. even before the msgbox pops up.

  10. #10
    Registered User
    Join Date
    12-04-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Macro to Create Message box based on cell values

    Quote Originally Posted by davesexcel View Post
    If you select "A" from the dropdown, the cell next to it is automatically selected. even before the msgbox pops up.
    Sir,

    it is working. It has just selected the cell. But there is a drop down menu on that cell too. I mean to say I need to activate the drop down menu in the respective 'V" cell as soon as I selected the "A" in the "U" cell along with the message box.

    Hope you can sort out this too..

    Thanks for your help sir.

  11. #11
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Macro to Create Message box based on cell values

    Try this.
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    12-04-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Macro to Create Message box based on cell values

    Sir,
    :-(

    it has just activated the cell and a small column has created in the respective cell. but not at all activated the pop down menu :-(
    ALso for your information, i had created the pop down menu using data validation..
    Last edited by aneshdas; 12-18-2013 at 09:33 AM.

  13. #13
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Macro to Create Message box based on cell values

    Could you attach a sample workbook?
    Last edited by davesexcel; 12-18-2013 at 09:39 AM.

  14. #14
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Macro to Create Message box based on cell values

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  15. #15
    Registered User
    Join Date
    12-04-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Macro to Create Message box based on cell values

    Sir,

    I hereby attached the sample work sheet. Only password I used on that workbook is 'master'.

    Also plz let me know how i can do the serial number in the "unauthorised list" page. since it will hide automatically the rows which are not absent. I need the continues numbers in the absentees list, except count the hiden rows.

    plz have a look in to this workbook and provide me your valuable advices for all the possible changes which can make the work sheet more accurateand attractive. also plz provide me more macros to beautify the workbook.

    Thanks in advance sir.
    Attached Files Attached Files

  16. #16
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Macro to Create Message box based on cell values

    I can't open your VBA project.
    Your sample should only reflect what you are asking

  17. #17
    Registered User
    Join Date
    12-04-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Macro to Create Message box based on cell values

    sir,

    Hope you got the sample file. Kindly update me.

  18. #18
    Registered User
    Join Date
    12-04-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Macro to Create Message box based on cell values

    sir,

    I dont know why you cannot open the same. "master" is the password I used for VBA too....Do you want me to send that again. I can open the same file here..

  19. #19
    Registered User
    Join Date
    12-04-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Macro to Create Message box based on cell values

    Quote Originally Posted by davesexcel View Post
    I can't open your VBA project.
    Your sample should only reflect what you are asking
    Plz check this sample file. hope you can open this file. Pasword used on this is "master".
    Attached Files Attached Files

  20. #20
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Macro to Create Message box based on cell values

    Please re-read post#16.
    Your VBA Project is password protected.

  21. #21
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to Create Message box based on cell values

    UNlock your vba, unlock your sheets, post that completely unlocked workbook. Try not to make people who want to help work any harder than they have to.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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. Create Auto-Calculating Cell and Assign Cell Values Based on a Macro
    By Titanium Fox in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-26-2013, 12:00 AM
  2. Macro message box based on cell content
    By ln2012 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-25-2013, 11:51 AM
  3. [SOLVED] Compare cell values of different Workbooks and prompt message using macro
    By jericlapuz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2012, 03:42 AM
  4. [SOLVED] Macro to create new worksheets based on column values in a sheet
    By Arjen@bigpond in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-01-2012, 11:18 PM
  5. VBA Macro to Create Sheets Based on Column of Values
    By chicagoland8 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2012, 11:39 AM

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