+ Reply to Thread
Results 1 to 4 of 4

Adding code to the end of a command button.

  1. #1
    Registered User
    Join Date
    12-09-2011
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Excel 2007
    Posts
    46

    Adding code to the end of a command button.

    I have two separate command buttons and i would like to add the second buttons code to the end of the first buttons code. It is deleting rows on a the sheet which the 1st button is located at. Any ideas would be awesome.

    Thanks
    Jeremy

    Button 1

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

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Adding code to the end of a command button.

    Rename: ComeUpWithABetterNameThanThis

    Please Login or Register  to view this content.
    Copy the above code into your module. Test it to see if it does the same thing as your button1 code.
    If so, then delete:

    Please Login or Register  to view this content.
    Replace it with your new name for: ComeUpWithABetterNameThanThis

    Add your new name for: ComeUpWithABetterNameThanThis to the end of button2.

    If you have questions, please ask!

  3. #3
    Registered User
    Join Date
    12-09-2011
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: Adding code to the end of a command button.

    Thanks a lot Steven!! Works good. One issue is when I delete all the zeros, there is always one left at the end that doesn't get deleted. Any suggestions?

  4. #4
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Adding code to the end of a command button.

    Can you upload your workbook, or a mockup workbook with the same problem?

+ 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