+ Reply to Thread
Results 1 to 7 of 7

Populating Further Cells with Previous Input

  1. #1
    Registered User
    Join Date
    12-03-2020
    Location
    USA
    MS-Off Ver
    2010
    Posts
    6

    Populating Further Cells with Previous Input

    Hello! Thanks in advance for the help -

    I'm trying to build a set of rules for an animal rearing worksheet. It's tedious and error-prone to add it all into a calendar by hand, so I'm hoping to save time. Ideally it would be something like:

    If cell = X (fed), cell+5 = Y (eggs)
    If cell+5 = Y (eggs), then cell+8 = Z (hatch)

    I'm trying to populate this into a compressed pseudo calendar. Would this be feasible? I've sorted how to change my cell based on what's within it, but that's not quite far enough for what I'm trying to do.

    Cheers!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Populating Further Cells with Previous Input

    We can't see your workbook, or deduce what cell and cell+5 actually mean.

    Attach a sample Excel workbook - the yellow banner at the top of the screen explains how to.

    Pete

  3. #3
    Registered User
    Join Date
    12-03-2020
    Location
    USA
    MS-Off Ver
    2010
    Posts
    6

    Re: Populating Further Cells with Previous Input

    If I put "AAEG Feed" in C2 I would want it to populate C5 (AAEG Egg) and C13 (AAEG Pupae). I've attached the workbook, but also copy/pasted it here to show an example. Thanks!


    December Date Tasks
    1 AAEG Feed
    2 ROCK Feed
    3
    4 AAEG Egg
    5 ROCK Egg
    6
    7
    8
    9
    10
    11
    12 AAEG Pupae
    13 ROCK Pupae
    14
    15
    16
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Populating Further Cells with Previous Input

    You'll need an event driven macro. Right click on the tab key and select "View Code" and paste this code into the large white text box in the VBA Editor window that will open up.
    Please Login or Register  to view this content.
    Then close the VBA Editor (no need to save). You will need to save your workbook as a .XLSM file. Any questions?
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    12-03-2020
    Location
    USA
    MS-Off Ver
    2010
    Posts
    6

    Re: Populating Further Cells with Previous Input

    Thank you!! That's super useful. I don't need to change it now, but in the future I may need to adjust pupation dates for different species. How would I write it? (I'm very new to code) I've put below what I would expect it to be, but it isn't running so I must have messed it up at some point.

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Populating Further Cells with Previous Input

    Okay, let's say the only two species that have a different time frame (from a multitude of species) are AAEG and AALB. Instead of separate IF statements for each one, you can use Else If...
    I don't think this is correct for you either (from your post) [let me know if I'm mistaken]
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I think you want
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Here's how I think the entire code will look
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-03-2020
    Location
    USA
    MS-Off Ver
    2010
    Posts
    6

    Re: Populating Further Cells with Previous Input

    Thank you all so much! That worked perfectly! I really appreciate it - my job just got a lot easier.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 02-27-2014, 05:44 PM
  2. If multiple comboboxes not used then stop populating cells at last combobox input
    By JacobBlue in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2013, 07:42 AM
  3. Populating a list based on previous row value
    By adame in forum Excel General
    Replies: 8
    Last Post: 03-18-2011, 02:44 PM
  4. populating blank cells with previous valid value
    By redhead in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-15-2011, 07:37 PM
  5. Replies: 2
    Last Post: 09-24-2010, 08:35 AM
  6. [SOLVED] erasing previous values from input cells after choosing from drop down menu
    By D.S.Rama Rao in forum Excel General
    Replies: 2
    Last Post: 05-06-2010, 06:04 AM
  7. Replies: 10
    Last Post: 04-27-2010, 11:31 AM
  8. [SOLVED] Populating fields based on previous column values
    By MMH in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-11-2005, 05:06 PM

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