Results 1 to 7 of 7

Updated: Require input to non-adjacent cells in a tab if cells in another tab are filled?

Threaded View

yl41012 Updated: Require input to... 11-08-2016, 06:25 PM
jaslake Re: How to equire input to... 11-09-2016, 03:38 PM
yl41012 Re: How to equire input to... 11-10-2016, 11:52 AM
jaslake Re: How to equire input to... 11-10-2016, 06:05 PM
yl41012 Re: How to equire input to... 11-10-2016, 09:00 PM
  1. #1
    Registered User
    Join Date
    08-12-2016
    Location
    DC, USA
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    22

    Updated: Require input to non-adjacent cells in a tab if cells in another tab are filled?

    As you can see in the attached spreadsheet, there are two tabs with data: By Major and By Concentration. Now if someone enters a number to any of the three cells H18, I18, or M18 in the By Major tab, I want to prevent the person from closing the spreadsheet without entering numbers to all of the columns C, E, F, G in the By Concentration tab for at least one row. For example, if someone has entered "6" to M18 to the By Major tab, I want the person to also enter numbers to C, E, F, G in the By Concentration tab for at least one row (e.g., row 5). If the person tries to close the spreadsheet without entering the required numbers, I want a message saying he needs to enter the required numbers.

    It is my final goal above, and now I even can't have the basic of the basic working. I have the code below, and apparently something is wrong. If someone could please help me, I'd greatly appreciate it.

    Thank you very much in advance!


    Private Sub Workbook_BeforeClose(Cancel As Boolean)
      If Len(Trim(Sheets("Sheet1").Range("H18").Value)) > 0 Then
         If (Trim(Sheets("Sheet4").Range("E5").Value)) = 0 Then
           prmt = MsgBox("Please enter numbers to column C, E, F, G in Sheet2 to at least one row.", vbCritical, "Name Required")
         End If
      Cancel = True
      End If
    End Sub
    Attached Files Attached Files
    Last edited by yl41012; 11-10-2016 at 08:26 PM. Reason: Attachment did not work; Sheet name was wrong.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sum adjacent cells based onion filled
    By jser63 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-04-2016, 08:16 AM
  2. Replies: 1
    Last Post: 11-09-2013, 06:11 AM
  3. How to keep an averaging cell empty until all the input cells are filled
    By troyer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-29-2013, 11:02 AM
  4. Require input data in certain cells if other cells are filled before saving
    By Jenkins86 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2013, 08:07 PM
  5. Replies: 4
    Last Post: 04-04-2012, 04:44 PM
  6. Formula Added Only When Adjacent Cells Filled
    By formula in forum Excel General
    Replies: 6
    Last Post: 03-18-2010, 12:29 AM
  7. Replies: 2
    Last Post: 03-22-2006, 01:25 PM

Tags for this Thread

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