Consulting

Results 1 to 4 of 4

Thread: VBA for looping cell change

  1. #1
    VBAX Newbie
    Joined
    Oct 2011
    Posts
    5
    Location

    VBA for looping cell change

    Hi,

    Firstly, using Excel 2003.

    I have 2 cells - g17 and g19.

    I need to write some code that will allow an input into these cells, and after the last input, prompt with a message box whether there are any other inputs required for these cells, and if so, remember the previous values and prompt for new values (of course focussing on cell g17 once again).

    I have hardly any experience with VBA - I tend to read code to try and understand what it is doing, and then playing around with it myself - so any help that anybody can provide would be valued.

    I believe I have to use a change event for the worksheet?

    Thanks.

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Welcome to the forum!

    A change event for the G19 cell should be sufficient. Not sure what you mean about remember the previous values. The cells will show the previous values until you overwrite them which changes them and would fire the sheet's Change event.

  3. #3
    VBAX Newbie
    Joined
    Oct 2011
    Posts
    5
    Location

    VBA for looping cell change

    Quote Originally Posted by Kenneth Hobs
    Welcome to the forum!

    A change event for the G19 cell should be sufficient. Not sure what you mean about remember the previous values. The cells will show the previous values until you overwrite them which changes them and would fire the sheet's Change event.
    Kenneth,

    I want to type a value in cell G17 (remember it for calculations on other sheets), type value in cell G19 (remember it for calculations on other sheets), THEN ask the user whether any more inputs are required for these cells, Yes - loop back to G17, No - continue with the action. Problem being, I don't know where to start!

    Thanks for the reply.

  4. #4
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    If a cell formula depends on another cell, changing the cell value updates those cells with dependent formulas. I don't see a reason for remember.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •