Results 1 to 6 of 6

Boolean Function to constrain another function

Threaded View

  1. #1
    Registered User
    Join Date
    03-20-2010
    Location
    Portugal
    MS-Off Ver
    Excel 2019
    Posts
    69

    Boolean Function to constrain another function

    Hi there,
    If possible i would like some help in the following matter:

    I have a function with a button that sendīs values from an excel cell in one sheet to another sheet, and i would like to have another function that checks if another 2 cells are empty and then pops up a msgbox giving a warning about the empty cells.
    If the 2 cells are empty the warning is given and the button will not send anything.

    At the moment i have something like this: (but the boolean seems not to work, something is wrong, because even with values on the cells CD11 and CE12 on sheet3 the button dont send anything).

    Private Sub Btn_Send_Arrival_Click()
    
        Call Check_ARRIVAL_Code
    
        MsgBox "before boolean is true"
    
        'If cell have values, button works and send values
         If ARRIVAL = True Then
    
            MsgBox "after boolean is true"
    
            'Send Comp.1 Bagagge
            Sheet1.Range("U34").Value = Sheet5.Range("T143").Value
    
        End If
        
    End Sub
    
    'Check when pessing button if the two ceels are empty
    Public Sub Check_ARRIVAL_Code()
    
        Dim ARRIVAL As Boolean
    
        If Sheet3.Range("CD11").Value = "" And Sheet3.Range("CE12").Value = "" Then
            MsgBox "Please put values in the empty cells"
            ARRIVAL = False
        Else
            ARRIVAL = True
        End If
    
    End Sub
    Thanks.
    Have a nice holidays everyone.
    Last edited by Blue_Wings; 12-28-2012 at 12:57 PM.

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