Results 1 to 18 of 18

Thread: Assignment Vs Condition

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Administrator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,306
    Location
    That will return a Boolean, in the example above that would return FALSE as 6 does not equal 5.

    You would use this for doing a comparison and returning TRUE/ FALSE.

    Take the below for example, in the first part of the code: 6 and 5 don't match so you get a FALSE
    In the second part 5 and 5 do match so you get a TRUE:

    Sub test()
        Dim b As Boolean
        
        b = 6 = 5
        Debug.Print b
        
        b = 6 = 6
        Debug.Print b
    End Sub
    Last edited by georgiboy; 05-07-2024 at 05:23 AM. Reason: Simpler example
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2408, Build 17928.20080

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •