+ Reply to Thread
Results 1 to 23 of 23

How To Create a Command Button

  1. #1
    Registered User
    Join Date
    05-22-2017
    Location
    Spring, Texas
    MS-Off Ver
    2016
    Posts
    30

    How To Create a Command Button

    Hello I'm new here and looking to get better at excel. I work in the oilfield which we use dailies to record what is going on through out the day. I trying to create a command button that will allow me to create a new daily each morning and paste the existing information onto that day. For example I want the new sheet to be named Day 2 and have my templet have all of the important info transferred with it along with the command button. Also I'm trying to figure out how I can transfer my total hours to my previous hours when creating a new sheet. I have attached a copy of my excel file so feel free to play around with it and see what you can come up with.
    Attached Files Attached Files
    Last edited by oneal1177; 05-22-2017 at 11:57 AM.

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: How To Create a Command Button

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: How To Create a Command Button

    Can you fill out Day 1 sheet and show what Day 2 would look like? And what is to happen with Job Info sheet?

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: How To Create a Command Button

    Instead of adding a button to each sheet I added a Button to the Ribbon. You'll see a Custom tab with a button to create a new sheet. There is a pop asking for new sheet name. Its just a start, and doesn't transfer hours yet. Need to know what needs to transfer and where you have formulas in Day 1 sheet are those to be copied as a formula or just the values?
    Attached Files Attached Files
    Last edited by mike7952; 05-22-2017 at 02:48 PM.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,602

    Re: How To Create a Command Button

    withdrawn.....
    Last edited by protonLeah; 05-23-2017 at 03:57 PM.
    Ben Van Johnson

  6. #6
    Registered User
    Join Date
    05-22-2017
    Location
    Spring, Texas
    MS-Off Ver
    2016
    Posts
    30

    Re: How To Create a Command Button

    Thank you for doing that Mike that is a great start. I was wanting a button so when I present this to other employees they can just see it and click on it.
    I think it would be just easier to explain it. Also, the Job Info tab is where I grab all of my basic job info like client name, rig name, who is on the job,
    and job details. I have filled out Day 1 and 2 so you can get a general idea of what I'm looking to do. Where I have my tool hours I would like for my total
    hours to automatically transfer over to the previous hours box when you click on a new daily button and to zero out the total hours. The same for the depth.
    Attach is an example
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-22-2017
    Location
    Spring, Texas
    MS-Off Ver
    2016
    Posts
    30

    Re: How To Create a Command Button

    Quote Originally Posted by oneal1177 View Post
    Thank you for doing that Mike that is a great start. I was wanting a button so when I present this to other employees they can just see it and click on it.
    I think it would be just easier to explain it. Also, the Job Info tab is where I grab all of my basic job info like client name, rig name, who is on the job,
    and job details. I have filled out Day 1 and 2 so you can get a general idea of what I'm looking to do. Where I have my tool hours I would like for my total
    hours to automatically transfer over to the previous hours box when you click on a new daily button and to zero out the total hours. The same for the depth.
    Attach is an example
    Oh and to update the date.

  8. #8
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: How To Create a Command Button

    See if this is does the job.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-22-2017
    Location
    Spring, Texas
    MS-Off Ver
    2016
    Posts
    30

    Re: How To Create a Command Button

    Yeah you got the hours working great but it doesn't keep the formulas in when plugging in new hours or in the time column. Also it doesn't update the date or the total footage drilled box towards the bottom. How can I see the code? When I opened up Visual Basic I just saw a blank page.

  10. #10
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: How To Create a Command Button

    Highlight the cells that need to be fixed. Over to the left you should see the worksheets modules and standard models. You'll need to open the mod_ module.

  11. #11
    Registered User
    Join Date
    05-22-2017
    Location
    Spring, Texas
    MS-Off Ver
    2016
    Posts
    30

    Re: How To Create a Command Button

    Ok I highlighted everything in an orange and Day 1 has the formulas that belongs in those boxes. I'm trying to update the date when creating a new day and to transfer the total footage over to the previous footage like the tool hours does.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    05-22-2017
    Location
    Spring, Texas
    MS-Off Ver
    2016
    Posts
    30

    Re: How To Create a Command Button

    Mike are you still there?

  13. #13
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: How To Create a Command Button

    Yes lol, I work 12/hr night shift and tonight is my last night. I will finish this up tomorrow afternoon. Sorry for the delay.

  14. #14
    Registered User
    Join Date
    05-22-2017
    Location
    Spring, Texas
    MS-Off Ver
    2016
    Posts
    30

    Re: How To Create a Command Button

    It is all good I appreciate all your help.

  15. #15
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: How To Create a Command Button

    See if this works for you.
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    05-22-2017
    Location
    Spring, Texas
    MS-Off Ver
    2016
    Posts
    30

    Re: How To Create a Command Button

    That works great but it still doesn't transfer the formulas over. I highlighted what boxes need to have formulas in them from Daily 1.
    Attached Files Attached Files

  17. #17
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: How To Create a Command Button

    Okay, cooking out now will look at sometime tonight.

  18. #18
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: How To Create a Command Button

    I didn't even see the formulas before. This should do it.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    05-22-2017
    Location
    Spring, Texas
    MS-Off Ver
    2016
    Posts
    30

    Re: How To Create a Command Button

    That works great. Thank you for your work. How can I change the name of the tab?

  20. #20
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519
    Name of what tab? The new sheets created? Just type new name into input box.

  21. #21
    Registered User
    Join Date
    05-22-2017
    Location
    Spring, Texas
    MS-Off Ver
    2016
    Posts
    30

    Re: How To Create a Command Button

    The My Oilfield Tab on the ribbon. I would like to change it to read Reports.

  22. #22
    Registered User
    Join Date
    05-22-2017
    Location
    Spring, Texas
    MS-Off Ver
    2016
    Posts
    30

    Re: How To Create a Command Button

    Mike are you still there?

  23. #23
    Registered User
    Join Date
    05-22-2017
    Location
    Spring, Texas
    MS-Off Ver
    2016
    Posts
    30

    Re: How To Create a Command Button

    Hey Mike how can I get the daily to create the new sheet the other way? For example the tabs go Day 1, 2, 3, 4.... but I want them to go Day ....4, 3, 2, 1
    Attached Files Attached Files

+ 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 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
  2. [SOLVED] Command button to create a pdf
    By tjdarla in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-12-2013, 10:23 PM
  3. Create a command button with code with a command button
    By jakara in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2013, 01:28 PM
  4. create a command button
    By mandyg23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2012, 05:14 PM
  5. create a command button for an add in
    By Blake 7 in forum The Water Cooler
    Replies: 3
    Last Post: 05-25-2011, 10:29 AM
  6. Create a Command Button
    By njg2982 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-27-2008, 08:04 PM
  7. [SOLVED] command button:. how can i create a command button
    By ashley in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 08-29-2005, 05:05 PM

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