+ Reply to Thread
Results 1 to 7 of 7

Command Button to Duplicate Sheet and Increase Values by 2%

  1. #1
    Registered User
    Join Date
    04-26-2017
    Location
    Myrtle Beach, SC
    MS-Off Ver
    2007
    Posts
    4

    Command Button to Duplicate Sheet and Increase Values by 2%

    I need some help with some coding on a command button...

    I want the command button shown in the below screenshot (Increase by 2%) to create a duplicate worksheet within the same workbook, and at the same time, increase the value of the fields highlighted in the screenshot below by 2% each.

    Can anyone help me with how to code this to do what I want it to do? It is very much appreciated!

    Rates Screenshot.jpg

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,234

    Re: Command Button to Duplicate Sheet and Increase Values by 2%

    Hi shergraves...
    Give this a go...Adapted from RoyUK
    Please Login or Register  to view this content.


    EDITED: My apologies, I noticed an error in code and have rectified....
    Last edited by sintek; 04-26-2017 at 01:42 PM. Reason: Amended code
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    04-26-2017
    Location
    Myrtle Beach, SC
    MS-Off Ver
    2007
    Posts
    4

    Re: Command Button to Duplicate Sheet and Increase Values by 2%

    Hi Sintek,
    Thank you for your quick reply! When I enter the code below, as pulled from your previous post (but to include U column), I receive an error "Runtime error 13: Type mismatch." When I click on debug, the code "cell.Value = cell.Value * (102/100)" is highlighted yellow. Thoughts? My code is below...

    Please Login or Register  to view this content.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,234

    Re: Command Button to Duplicate Sheet and Increase Values by 2%

    Column U contains merged cells so does cause complications...It does work however till Col T right.....
    Upload a sample file and I'll work on rectifying to include Column U.
    Originally Posted by Pete_UK
    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,234

    Re: Command Button to Duplicate Sheet and Increase Values by 2%

    see amended code in Post 2 ...It works just changing T to U

    Keep this line
    Please Login or Register  to view this content.
    Last edited by sintek; 04-26-2017 at 01:43 PM.

  6. #6
    Registered User
    Join Date
    04-26-2017
    Location
    Myrtle Beach, SC
    MS-Off Ver
    2007
    Posts
    4

    Re: Command Button to Duplicate Sheet and Increase Values by 2%

    AHHH! I fixed it! Haha! In one of the last few rows, column U contained the value "N/A" which is what was throwing it off. It DOES work on the merged cells, however, so I believe I am good to go. Thank you again so much for your help! Saves me SO much time and effort!

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,234

    Re: Command Button to Duplicate Sheet and Increase Values by 2%

    Glad you got it working...Thanks for rep points

+ 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. VBA Macro for a command button to Delete Row and duplicate rows
    By Andrew J in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2016, 09:51 AM
  2. Insert Command Button that will Activate Command Button on a Different Sheet
    By realvirtuality1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2016, 02:11 PM
  3. VBA code to create command button. Print all sheets then delete command button.
    By Declamatory in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-15-2015, 05:18 PM
  4. Replies: 34
    Last Post: 08-12-2014, 04:02 AM
  5. Replies: 1
    Last Post: 10-24-2013, 08:58 AM
  6. increase font size of command button name
    By sepandb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-23-2008, 09:15 PM
  7. Command Button to increase cell value
    By Hawker in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-31-2007, 10:04 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