+ Reply to Thread
Results 1 to 8 of 8

Noob question related to IF statements, and cell population.

  1. #1
    Registered User
    Join Date
    12-14-2017
    Location
    Winnipeg
    MS-Off Ver
    2007
    Posts
    4

    Noob question related to IF statements, and cell population.

    Hey all, I'm new here, but I've seen some really helpful stuff, and am hoping to have some information I saw in an earlier thread built on.
    Another user had some issues with using IF statements, and I think I can use them to solve the problem I have, but I'm not sure how.
    What I would like to do, is have users (some employees of mine) input a number into a cell, for example the number "5", and instead of that cell accepting this at face value, I would like Excel to instead populate that cell, and the next four cells with a "1".
    An example would be this (manually inputted of course).
    4579522651.png
    So Cell A9 would be "incorrect", and Cells C9-13 would be correct.
    I believe using an IF statement will accomplish this, but I'm not sure how to proceed with that information.
    I would be eternally grateful for any info, or help you wonderful people could provide!

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,830

    Re: Noob question related to IF statements, and cell population.

    For clarification: Are you saying that if a user enters a number in column A, you want column C starting at that row number in column A to have a 1 entered for as many times equal to the value in column A? Is anything to happen in column B?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    12-14-2017
    Location
    Winnipeg
    MS-Off Ver
    2007
    Posts
    4

    Re: Noob question related to IF statements, and cell population.

    The example was just something I quickly made up for a visual reference.
    Basically, which ever column a user picks, if they enter a value into an empty cell, that column only would be updated.

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

    Re: Noob question related to IF statements, and cell population.

    Hi JaXm and welcome to the forum,

    I think you want some VBA to do what you want, like:
    Please Login or Register  to view this content.
    VBA for JaXm.xlsm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    12-14-2017
    Location
    Winnipeg
    MS-Off Ver
    2007
    Posts
    4

    Re: Noob question related to IF statements, and cell population.

    This is really awesome! I have a question though. Can this be modified so that if a value is entered into column A, it affects column A? In your example, a value in Column A changes the values of cells in a different column (one defined by the code, in this case "C"), but is it possible to have the value of column A (whether it be 5, 4, 16000, etc) be calculated in that same column, including the inputted cell?

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

    Re: Noob question related to IF statements, and cell population.

    I think the answer to your question is YES.

    The trick is to use the set the Application.EnableEvents to False so when you enter the new value into column A it doesn't trigger an event. The below code will take a number you enter into column a and multiply it by the row number.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-14-2017
    Location
    Winnipeg
    MS-Off Ver
    2007
    Posts
    4

    Re: Noob question related to IF statements, and cell population.

    You've been super helpful. Would there be a resource that's readily accessible that would shed some more light on how excel uses VBA? It's been quite a while since highschool (the last time I did anything with Basic), and I'd like to refresh myself on what commands are relevant. I still have a bit of a hard time boiling down even this small amount of code into it's primary concepts.

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,830

    Re: Noob question related to IF statements, and cell population.

    You can start by looking at the very first thread in this forum. It is at the top and is colored in blue.

+ 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. [SOLVED] Noob: don't know how to write IF statements for =mid formula (simple code)
    By lougs7 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-19-2015, 11:43 AM
  2. Sort Row to Column given Rule
    By sourgreen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-25-2014, 06:00 PM
  3. Replies: 0
    Last Post: 07-10-2012, 08:37 AM
  4. Tricky Cell Population Question
    By hashmio9 in forum Excel General
    Replies: 2
    Last Post: 12-14-2011, 06:14 PM
  5. Hi all! Noob here with a question.
    By sandman512 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-26-2007, 03:41 PM
  6. [SOLVED] Noob question
    By letmeplay1977 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-05-2005, 05:05 PM
  7. Update cell based on date range - noob question
    By deversole in forum Excel General
    Replies: 8
    Last Post: 07-08-2005, 09:00 AM

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