+ Reply to Thread
Results 1 to 13 of 13

Two cell accumulator then reset first cells

  1. #1
    Registered User
    Join Date
    01-19-2008
    Posts
    16

    Two cell accumulator then reset first cells

    Hi all,
    I havent used macros in a long time and have a large excel document to do at work.
    I could do with some help with a small part of the sheet which is comparative to other areas of the sheet.

    To simplify this so that I can then take the advice and utilise it throughout the sheet. I need help with the following please.

    I basically have four cells
    c8 = goods in (new components in)
    c9 = kanban stock (current qty in stores)
    c10 = current stock (=kanban stock minus allocated)
    c11 = allocated (number on order)

    What I would like to be able to do is enter a figure in c8. This would then start the macro to update c9,10 and 11.
    The problem I have is that if i enter a figure into c8 sure it alters the others if i do a quick =sum formula but does not reset. Therefore if I put for example 6 in cell c8 and then want to add another 8 all other cells alter accordingly. I want all cells apart from c8 to update and hold the figure after c8 has been entered.

    Hope this makes sense

    Regards

    Shaun

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    I am not sure I fully understand what you are after

    This macro when installed correctly & the Macro security level set to allow macros to run update the value in C9 when C8 is changed. The updated value in c9 is C8 + C9



    'These instructions pre typed & are worded to cater for the novice programmer
    'To install macro to correct location

    'Copy this macro
    'GoTo Excel
    'Select sheet this is to appy to
    'Right Click on Sheet Name Tab > select View Code
    'Past macro into the Worksheet Module displayed

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Registered User
    Join Date
    01-19-2008
    Posts
    16
    Hi
    Thanks for your reply
    I followed what you said and nothing happens?
    Regards
    Shaun

  4. #4
    Registered User
    Join Date
    01-19-2008
    Posts
    16

    Two cell accumulator then reset first cells

    Hi
    I posted a request for help a couple of days ago and probably confused the issue

    What I am trying to do is have two cells ( Say C8 and C9)
    I want to use c8 to add number data and I want c9 to keep its original number and add the figure in c8 to it.
    Then I would like c8 to reset but c9 to keep the new number
    When I then enter a new number into c8 I want to repeat the process

    So for example I enter the number 2 into c8 then c8 and c9 should = 2. Cell c8 resets but c9 keeps the figure 2

    If i now add the number 2 to c8 again then c8 should reset and c9 should = 4 and so on.

    Is this possible ?

    Any help greatly appreciated

    Shaun

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Right click the sheet tab > select view code > paste in the below

    Amended to clear C8

    Please Login or Register  to view this content.
    VBA Noob
    Last edited by VBA Noob; 01-20-2008 at 10:33 AM.
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Registered User
    Join Date
    01-19-2008
    Posts
    16
    You my friend are an absolute star
    I am not worthy

    Thanks so much

    Shaun

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Your welcome.

    Please now delete the old post

    VBA Noob

  8. #8
    Registered User
    Join Date
    01-19-2008
    Posts
    16
    Ok... As you answered that so quickly a couple more questions for you

    Now I have the formula you did for me the true extent of the problem is as follows

    Instead of just c8 and c9 as mentioned the true cells are
    K5 and I5

    Is it just as simple as going to code page and changing the values.

    I then want to reproduce this all the way down the screen so

    K5 alter I5 all the way down to k150 alters I150

    Now you have done the first part is this a simple continuation?

    Thanks
    Shaun

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    I've merged your posts as mudraker replied

    Try

    Please Login or Register  to view this content.
    VBA Noob

  10. #10
    Registered User
    Join Date
    01-19-2008
    Posts
    16
    This works perfectly. Your good at this

    Final question. If i wanted to change the range to say k`55 and not K150 do I just view code and replace 150 with 155?

    This is sure to be the final question

    Thanks

  11. #11
    Registered User
    Join Date
    01-19-2008
    Posts
    16
    K'55 was meant to read K150 of course

  12. #12
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try it and see

    VBA Noob

  13. #13
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Amended

    Thread deleted for not wrapping code as per rules below


    VBA Noob
    Last edited by VBA Noob; 01-20-2008 at 03:02 PM.

+ 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