+ Reply to Thread
Results 1 to 7 of 7

stopping auto updateing of cells

  1. #1
    Registered User
    Join Date
    08-29-2007
    Posts
    45

    stopping auto updateing of cells

    I have a sheet to calculate points scoring for an incentive I'm running for my staff. (sample sheet has been attached)

    I have coded a macro to copy certain cells when it comes to the end of a week so that we can start with fresh figures, but also keep a running total.

    If you look at the sample sheet, column X contains the score for the current week, column Y is the previous weeks score and column Z is the running total.

    When I run the macro the sum of X & Y is pasted into Z and columns D to U (which contain the point calculations) are cleared which obviously means the value in X is now blank.

    This is also reducing the value in Z because the sum X+Y is auto updating.
    How can I stop this from happening?

    The code I'm currently using is below

    Please Login or Register  to view this content.
    Thanks for any help given.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    02-08-2004
    Posts
    58
    What I do in those cases is use the first part of the macro to dump X1 and Y1 into a new cell, then do all your VB calcualtions from the x2 y2 cells, not the original ones.


    Its the most simple way I have thought of at least.
    Sig ? How can I sign the computer screen ?

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    Hi,
    Give this a try,
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Whoa!,

    Whenever you see repetitive code like that you can be almost certain that it can be simplified considerably. It looks like it's been recorded with the macro recorder, which is great for starting off with, but in the majority of cases it should only be a starting point. Almost invariably it should be modified and edited.

    Replace it with the much simpler code below.

    Please Login or Register  to view this content.
    HTH

  5. #5
    Registered User
    Join Date
    08-29-2007
    Posts
    45
    Quote Originally Posted by Richard Buttrey
    Whoa!,

    Whenever you see repetitive code like that you can be almost certain that it can be simplified considerably. It looks like it's been recorded with the macro recorder, ....

    HTH
    Hey Richard, you guessed right.

    My understanding of vba is soooo basic, but you're right the macro recorder does the job until I learn more about coding.

    Thanks for the code.

  6. #6
    Registered User
    Join Date
    08-29-2007
    Posts
    45
    Hi Dave,

    unfortunately your code isn't working.
    It copies X accross into Y but then Z reverts back to the new value in Y and the code
    Please Login or Register  to view this content.
    is pasted into X

    Unfortunately I don't know what you're code is doing so I have no idea what the problem is.

    Are you able to help further?

    Quote Originally Posted by davesexcel
    Hi,
    Give this a try,
    Please Login or Register  to view this content.

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    Quote Originally Posted by SRussell
    Hi Dave,

    unfortunately your code isn't working.
    It copies X accross into Y but then Z reverts back to the new value in Y and the code
    Please Login or Register  to view this content.
    is pasted into X

    Unfortunately I don't know what you're code is doing so I have no idea what the problem is.

    Are you able to help further?
    Did you look at the formula in column x after you ran the macro??
    you can't run the macro again until you have data in the appropriate cells, or you will just be transferring zero values to the next column.

+ 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