+ Reply to Thread
Results 1 to 7 of 7

How to wrie a macro to create a dialogue box with a command button?

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    35

    How to wrie a macro to create a dialogue box with a command button?

    Hello all,

    i have written a macro to calculate certain values and it is successful.

    now, i need to display a dialogue box when an excel sheet is opened, having a welcome text as " A Tool for data post processing" and a command button as "Run the macro".

    when this command button is clicked, the macro which i have created should run.

    i am new to writing a macro for buttons or dialogue boxes and have no idea on how to do it.

    any suggestions is welcome .
    awaiting your response.

    thank you
    Roopa

  2. #2
    Registered User
    Join Date
    12-17-2011
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: How to wrie a macro to create a dialogue box with a command button?

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

  3. #3
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Pune
    MS-Off Ver
    Office 365 (Win 10)
    Posts
    489

    Re: How to wrie a macro to create a dialogue box with a command button?

    For displaying message, you can try this

    And for getting a button, just go to developer option>>Insert>> First button(or Box) draw that as per your need>>right click on the box>> assign macro>> Done

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to wrie a macro to create a dialogue box with a command button?

    Try liket this by adding the below code in Thisworkbook Code window

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  5. #5
    Registered User
    Join Date
    04-16-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: How to wrie a macro to create a dialogue box with a command button?

    Thanks all.

    i tried these codes. it works without any codes but the userform is not displayed.

    but i have a very basic doubt. kindly excuse my dumbness..

    should i give these codes in a seperate module of code or should i write this where the userform is created.

    Thanks
    Roopa

  6. #6
    Registered User
    Join Date
    04-16-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: How to wrie a macro to create a dialogue box with a command button?

    Please Login or Register  to view this content.
    This is the code i get when i go to "view code" of the userform which i have created.

    so should i enter the codes which u all gave into this code or seperately?

    Roopa

  7. #7
    Registered User
    Join Date
    04-16-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: How to wrie a macro to create a dialogue box with a command button?

    all of these codes are working.

    but how do i get the userform displayed?

    it is directly running my macro.

+ 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