+ Reply to Thread
Results 1 to 8 of 8

Force Cells to be completed based off another cell

  1. #1
    Registered User
    Join Date
    12-31-2018
    Location
    Leeds
    MS-Off Ver
    Excel
    Posts
    4

    Force Cells to be completed based off another cell

    Afternoon.

    I am trying to use VBA to put measures onto a spreadsheet to no avail.

    I am looking for some help with coding for the following.

    Once D2 is completed I'm looking for each cell after up to J2 to be mandatory
    If a cell is attempted to be completed not in sequence to remove the data and error to pop up
    have this repeated for each row on the spreadsheet (700)
    There will be some rows that only go up to C ( this seems to be where I am having the problem)

    Any help would be great

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2007
    Posts
    1,297

    Re: Force Cells to be completed based off another cell

    You should attach a sample workbook to show the setup and fill in expected result.
    Also, How does the program know how far each row needs to be filled in?
    You say some rows go up to C and others may go up to J.
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

  3. #3
    Registered User
    Join Date
    12-31-2018
    Location
    Leeds
    MS-Off Ver
    Excel
    Posts
    4

    Re: Force Cells to be completed based off another cell

    I've attached a sample of what the spreadsheet looks like fully completed.

    The coding that I was using only looked from D on wards to J but was getting error messages when there was a row that didn't go past D.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2007
    Posts
    1,297

    Re: Force Cells to be completed based off another cell

    Still not clear what you are looking for.
    Is it always true that data doesn't need to be filled in if column C is "No"?
    You need to define the logic to be used to determine how many columns need to be filled in.
    For example:
    If I start typing in D3, is it ok while C2 is "No"? what id C2 was a "Yes", would I be allowed to type in D2? How many columns would I be expected to fill in?

    Please define your requirements clearly.

  5. #5
    Registered User
    Join Date
    12-31-2018
    Location
    Leeds
    MS-Off Ver
    Excel
    Posts
    4

    Re: Force Cells to be completed based off another cell

    So I am looking for the cells in the row for column E-J to be mandatory if there is a value in D.

    So in theory if a value is inputted in D2 it forces them to input details into E2 and then F2 and so on until J2, and if they try to enter it in a cell that is not in order to remove this and show a pop up

    There are a few options that they can input into column C - only if it is a yes will they need to fill in the remaining cells

  6. #6
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Excel for Windows & Mac - all versions.
    Posts
    24,299

    Re: Force Cells to be completed based off another cell

    This is probably best achieved with a macro. Are you comfortable with that or are you looking for some function only solution?
    Richard Buttrey

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

    Forum Rules Updated September 2018. Please read them by clicking here.

  7. #7
    Registered User
    Join Date
    12-31-2018
    Location
    Leeds
    MS-Off Ver
    Excel
    Posts
    4

    Re: Force Cells to be completed based off another cell

    Ive only started looking into VBA so I'm a bit useless , this is a code that I was using but seem to have hit a brick wall as doesn't like the rows where it doesn't go past "C"


    Please Login or Register  to view this content.
    Last edited by AliGW; 12-31-2018 at 01:16 PM.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    23,663

    Re: Force Cells to be completed based off another cell

    Nathan - please note that programming code should be wrapped in code tags. As you are a new member, I have done this for you this time. Please do it yourself in future.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    STOP PRESS: Forum Rules Updated September 2018! Please read them here.
    Are you new to Power Query and don't know what to do with the code you've been given? Have a look here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

+ 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