+ Reply to Thread
Results 1 to 4 of 4

Adding "Command Button" and "Messages Box" in VBA Macro

  1. #1
    Registered User
    Join Date
    08-09-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    10

    Adding "Command Button" and "Messages Box" in VBA Macro

    Hi,

    I have created a macro saved in Personal workbook. I am able to run the Macro saved in Parsonal workbook on other active workbooks whichever is opend.
    I am looking for Inserting "Command Buttons" and "Messages box". I am not sure on how to do.
    Any assistance will be really helpful!!

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Adding "Command Button" and "Messages Box" in VBA Macro

    Hi, sanjeevkumarmc,

    could you please elaborate why you would need to insert command Buttons? A sample for working with the messagebox could be found in the VBA Help:
    Please Login or Register  to view this content.
    Please remember: the more information you pass the easier it should be to offer a solution to your problem.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    08-09-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Adding "Command Button" and "Messages Box" in VBA Macro

    Hi, Thanks for the reply. Surely i ll give the details.

    I am very much new to the Macros, so please let me know whatever the details you require

    > I have created a macro in Personal.XLSB and the codes are in modules and i am using this macro to Run on other workbooks which i am opening.
    > I Would like to provide the "START" button so that users can use easily instead of using ALT+F8 to run the macro. (Not sure if we can add the Start button in the Personal.XLSB workbook)
    > Also after the Macro is complete, would like to show the message as "Macro Completed Successfully".
    >Where should the above codes provided by you should be updated. (Is it in the module where i have my codes or should i insert the "User Form".

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Adding "Command Button" and "Messages Box" in VBA Macro

    Hi, sanjeevkumarmc,

    if you insert a new button into each workhseet and rely on your personal.xlsb the macro button would still be there if anybody else opens the workbook but will fail as your workbook will not be available. It pretty much would be if you use an AddIn for that type as that AddIn would be addd to the list of AddIns in order to work.

    If you press ALT+F8 the macro window will appear. You could assign a shortuct to your macro which would enable you to run the macro from every workbook without instering any buttons but just pressing the combination you choose. I think that to be a better way than inserting macro buttons, assigning macros to them and deletiung them after work in order not to run into run time errors. You could work around by creating a ribbon and inserting the macro there so it would not be run from the personal.xlsb. A start button on the personal.-xlsb doiesn´t make that much sense as that workbook is hidden by default, you could add a new item to the AddIns ribbon part.

    Regarding the MsgBox after completion of the macro. Insert the code into a new workbook after inserting the code into a standard module into that very same book and run it:
    Please Login or Register  to view this content.
    Ciao,
    Holger

+ 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. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. Create a Command Button to "Save As" and "Close" an Excel Workbook
    By thedunna in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-26-2013, 05:38 PM
  5. How to change a Command Button caption from "Enable" to "Disable"?
    By Infinity in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2007, 12:14 AM

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