+ Reply to Thread
Results 1 to 6 of 6

Month to End Calculation

  1. #1
    Registered User
    Join Date
    05-18-2005
    Posts
    17

    Month to End Calculation

    Hi,
    sorry for my bad posting. Thank you.
    Here we go,

    I have this code that i found in a website:
    Please Login or Register  to view this content.
    end sub

    how can i make it work for other cells in the same workbook?
    also i have a problem when enter a new values in the cell and ask me if i want to add the new values to MTD and if say no, i will not work anymore.

    Any idea why?

    thank you again
    Last edited by arthurbr; 10-31-2010 at 12:32 PM. Reason: Month To End Calculation

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Mtd

    Please change your thread title, before the moderators get you...

    Forum Rules And Guidance
    1. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help,

    Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change the title of the thread, click EDIT on the original post, then click the Go Advanced button, then change the title. If two or more hours have passed, the EDIT button will not appear, and you need to ask a moderator to change the title.

    Also please wrap your code in code tags

    Forum rules
    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # button at the top of the post window. If you are editing an existing post, press Go Advanced to see the # button.

    Cheers

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Mtd

    Hey Josros60,
    Edit your first post using the Green Button and then go to advanced and change the Title above the message. Highlight your code and then click the # icon to put code tage around it. After that read my answer.

    Creat a named range of cells. Select all the cells you want this to happen to and name them using Formula Names Manager. Then change the code to look for the name instead of a range of cells.
    The second part of your question - move the Enable Events below the End If.

    Fix your title first and then study the answer. Read the rules please.

  4. #4
    Registered User
    Join Date
    05-18-2005
    Posts
    17

    Month to End Calculation

    Hi,

    thank you for your response and correction about posting the code, here it's the code putting enable events at the end but it doesn't work:

    Please Login or Register  to view this content.
    sometimes work sometimes not, by the way how can format the "&Target & with dollar format number when it shows in the message box?

    thank you again
    Last edited by josros60; 10-31-2010 at 01:51 PM. Reason: . VBA for Change_Event and InNumeric Problem

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Mtd

    Hi,

    The sometimes work and sometimes not may depend on if the Target is numeric. If you try to act on text the code is just jumped over. I'd bet you are entering a comma or dollar sign in the number so Excel thinks it is text insted of a numeric value.

    To display your target in a different format look for CCur or Type Conversion Functions in the VBA help file, or on the net.

    One more thing you need to do - so the Forum Moderators don't get mad at us is to change the Title of your question. Go back to the original post and Edit it. Then go to the advanced and above the message change the Title of this thread to .... how about.... VBA for Change_Event and InNumeric Problem ..
    Last edited by MarvinP; 10-31-2010 at 12:20 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Mtd

    Joros as Marcol suggested you should change the title of yoyr original post, not the subsequent ones. I will do it for you this time;

    This is useful for other members to see what your thread is about

+ 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