+ Reply to Thread
Results 1 to 4 of 4

When workbook open, add a commandbutton to last sheet with macro command

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,078

    When workbook open, add a commandbutton to last sheet with macro command

    hi, everyone

    when my workbook open then add a commandbutton to the last sheet of workbook with macro

    like here

    add button and add this line to call macro

    Please Login or Register  to view this content.
    thnx
    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: When workbook open, add a commandbutton to last sheet with macro command

    You could record a macro to add a button to the last sheet.
    The use this and edit so that you know it is the last sheet.
    Then you can place it in the WorkBook Open and it will work.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,078

    Re: When workbook open, add a commandbutton to last sheet with macro command

    Thanx for the reply dear Keebellah

    i found this code, but its not creating a active x button, will you please give any suggestion

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: When workbook open, add a commandbutton to last sheet with macro command

    Like I said record your OWN macro and then edit it.
    The macro works but my guess it is not adding the button to the sheet you want.
    It does it in the "ACTIVE" sheet. so look there.

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: When workbook open, add a commandbutton to last sheet with macro command

    Just copy this macro in the Thisworkbook VBA

    Please Login or Register  to view this content.

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: When workbook open, add a commandbutton to last sheet with macro command

    Just copy this macro in the Thisworkbook VBA

    Please Login or Register  to view this content.

+ 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. Macro in workbook app to change default (open command) directory.
    By Audiology in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-24-2012, 08:33 AM
  2. Macro, copy UNLOCKED cell range of sheet in open workbook to workbook template
    By NicksDad in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-31-2012, 11:18 AM
  3. Command line for open excel, insert a sheet, execute a macro, save file exit?
    By uschxc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2012, 12:28 PM
  4. On the click event of commandbutton open another excel workbook
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2010, 06:28 AM
  5. Copy Sheet with Command Button to new Worbook and assign macro in new workbook
    By grey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2010, 05:33 AM
  6. [SOLVED] Commandbutton to Workbook Open
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-27-2006, 11:50 PM
  7. Command Button Macro Sheet>New Workbook
    By jgp_2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-30-2005, 03:40 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