+ Reply to Thread
Results 1 to 8 of 8

Button to run macro with formulas

  1. #1
    Registered User
    Join Date
    08-03-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    21

    Cool Button to run macro with formulas

    Daily Housekeeping.xls

    how do i create a button in cell C8 that will trigger a macro to calculate days

    basically here is the calculation i am looking for

    Please Login or Register  to view this content.
    i hope this explains what i am trying to do, if you want to play with the file i have here you can see, but if you can put in the code and are able to 'describe what this line is doing i would very much appreciate it.

    i have the idea of what i am after but am failing miserably to get it to work

    thanks

    daluv

  2. #2
    Registered User
    Join Date
    08-03-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Button to run macro with formulas

    can anyone help me get started with the scripting?

    would really appreciate it.

    daluv

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Button to run macro with formulas

    Hello there,

    I'm a little unsure as to what you are trying to do.

    In cell B8 you want today's date or you wanted the entered date?

    And then from there I'm not sure exactly what you are trying to do. Could you please modify your worksheet to have an additional worksheet that mimics your desired results from a macro?

    Thanks!

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Button to run macro with formulas

    Alrighty, I think I may have got it, sorry originally I was reading your request wrong.

    Attached you will find your original workbook update to include a command button that runs a code I believe accomplishes what you are trying to do

    To insert the code into your workbook:

    1.Press Alt+F8 on your keyboard
    2.Clear the macro name box and type AddDifference in the blank box provided
    3.Select the Create option
    4.In between the Sub AddDifference() and End Sub copy and paste the below code:

    Please Login or Register  to view this content.
    5.Anything that appears in green is a comment I left to help you understand. Exit out of the Visual Basic Window.
    6. On the main excel menu select the Developer tab and then select Insert. Select Command Button option and place it on you workbook. Select the InsertDate macro in the Assign Macro pop up window. and then select okay
    7.Select the command button to run the code

    Let me know if this is what you were looking for or if you have any questions.

    Thanks1
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Button to run macro with formulas

    Maybe this works as you need:

    Please Login or Register  to view this content.
    I hope that helps.
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

  6. #6
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Button to run macro with formulas

    Hello there,

    Thanks for the star tap! Don't forget to mark this thread solved if you've received an answer that accomplishes your goal. Thanks!

  7. #7
    Registered User
    Join Date
    08-03-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Button to run macro with formulas

    sorry i have been working all day with the people on the list with something different. i am reading their codes right now and will put them in my template to test hopefully this weekend. i have already gave them both a star for their replies and i love what they have given me so far. i will mark solved when i get to run it.

    daluv

  8. #8
    Registered User
    Join Date
    08-03-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Button to run macro with formulas

    this was awesome guys thanks for the input, still playing with getting it inserted. but thanks

    daluv

+ 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