+ Reply to Thread
Results 1 to 5 of 5

Check if a cell from the same row but different column is empty

  1. #1
    Registered User
    Join Date
    02-28-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    23

    Check if a cell from the same row but different column is empty

    Hi,

    Hopefully a simple fix but can't for the life of me figure it out.

    If I enter a number in Column F (any cell, lets say F10 for this example), I would like it to check the corresponding cell in Column A i.e. A10 for a value.

    If the cell is empty in A10, it removes the value the user has entered into F10 with the message "Missing corresponding item No in Column A. Costs can only be entered alongside an Item No".

    I have tried the following but to no avail. I get the message regardless of if the condition is met or not, any column I type in etc.

    Hoping someone can help.
    Many Thanks Steve

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,613

    Re: Check if a cell from the same row but different column is empty

    You could do this using the Data Validation feature on the Data menu.
    • Select F1:F5000
    • Select Data\Data Validation
      • Allow: Custom
      • Formula: =A1<>""
      • Configure your message on the Error Alert tab
      • Okay
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    02-28-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    23

    Re: Check if a cell from the same row but different column is empty

    Hi,

    Have followed exactly what you suggested and this doesn't work. The message appears regardless if there are entries in both columns, no entries, one in one column and not the other and so on.

    To be more clear sorry, even if there is a value on column A, its stops me from putting a value in Column F, which is shouldn't. Only if there is no value in the same row number in Column A should it stop me putting a value in Column F.

    Cheers
    Steve
    Last edited by Stephen Troughton; 04-27-2018 at 07:31 AM.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,613

    Re: Check if a cell from the same row but different column is empty

    Quote Originally Posted by Stephen Troughton View Post
    Hi,

    Have followed exactly what you suggested and this doesn't work. The message appears regardless if there are entries in both columns, no entries, one in one column and not the other and so on.

    To be more clear sorry, even if there is a value on column A, its stops me from putting a value in Column F, which is shouldn't. Only if there is no value in the same row number in Column A should it stop me putting a value in Column F.

    Cheers
    Steve
    I've tried it and it worked for me. So something is different.

    If you selected F1:F5000 by dragging from the bottom up and the active cell was F5000 when you applied the DV formula, then the DV formula doesn't apply properly. Try selecting all of Column F with F1 being the active cell and then re-apply the Data Validation as before.

  5. #5
    Registered User
    Join Date
    02-28-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    23

    Re: Check if a cell from the same row but different column is empty

    Hi,

    Works fine now, thank you so much.

    Regards Steve

+ 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] Check if value is in range, and if so check cell on row empty
    By tool_fairy in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-21-2017, 10:35 AM
  2. [SOLVED] want to check for empty cell with vba
    By jim808 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-08-2016, 09:19 PM
  3. [SOLVED] Paste formula to the last empty cell based on a non-empty cell on another column
    By bhenlee in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-02-2015, 04:07 PM
  4. Find Empty Cell Check Next Column For a Value
    By basketball2524 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-19-2014, 11:21 AM
  5. [SOLVED] How to check for an empty cell
    By Turtleman10 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-26-2012, 08:32 AM
  6. check 1st empty cell then delete column
    By emina002 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2012, 09:36 PM
  7. check a cell is empty or not
    By associates in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-20-2006, 05:43 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