+ Reply to Thread
Results 1 to 8 of 8

Limitations of "OR" Logical Operator

  1. #1
    Registered User
    Join Date
    12-04-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    43

    Angry Limitations of "OR" Logical Operator

    To protect my Application from unauthorized use, I want to use hex Serials of particular systems and create a list of those serials in a module. If the serial of system matches with that of the serials given in my module (this module runs at the workbook open event) then access is given else application quits.
    I have coded like this
    If code <> "Serials" or code <> "Serials" ....
    Application.DisplayAlerts = False
    Application.quit
    End if
    I want to know how many times this "Or" can be used, i.e. if there is any limitation on its use.
    Or
    Can you suggest me a better way to accomplish this task.
    Thanks

    Sincerely

    Vivekchha

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Limitations of "OR" Logical Operator

    What is the difference between these two?

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    12-04-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Limitations of "OR" Logical Operator

    These are just examples. Serials are generated with the help of other module. I send this module to prospective user and then user generates the serials and send back to me the particular serials which I authorize in my module. Whenever he runs my application on his system the application checks for the serials of his system and if the same are found in my module, access is given else application quits. So simple.
    While allowing access I have to use logical operator "Or" many times. So I just wanted to know if there is any limitations on its use or if I can create a custom list in my module to match those serials. If yes, then how?
    Thanks
    Sincerely
    Vivekchha

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Limitations of "OR" Logical Operator

    I suggest you not to go for nested OR instead have a look in using Match function in VBA (Works on Range / Array) which can do the comparison in the loaded array which takes one line of code and works faster too

  5. #5
    Registered User
    Join Date
    12-04-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Limitations of "OR" Logical Operator

    Thanks Sir.

    I would just try and then get back to tell the result.

    Sincerely
    Vivekchha

  6. #6
    Registered User
    Join Date
    12-04-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Limitations of "OR" Logical Operator

    Sir,
    I learnt how I can create an array and store the serials in those arrays. But how to find that a specific value resides in an array.
    Say I created 10 arrays by
    dim myCheck(1 to 10) as string
    Now I assigned values to the arrays
    myCheck(1)="Hello1"
    myCheck(2)="Laila2"
    myCheck(3)="Ravina3"
    Now I want to check if any of array value matches with my string or not.
    I do not know how to accomplish it.
    I want the code to return TRUE if myStr matches with any of the array else return FALSE.

    Sincerely
    vivekchha

  7. #7
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,662

    Re: Limitations of "OR" Logical Operator

    Please Login or Register  to view this content.
    Ben Van Johnson

  8. #8
    Registered User
    Join Date
    12-04-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Limitations of "OR" Logical Operator

    Sir,

    Thanks for your reply. However I have done the task in the following way.
    For i = LBound(myCheck) To UBound(muCheck)
    If InStr(myCheck(i), myStr) > 0 Then
    MsgBox ("Welcome Friend!")
    Exit Sub
    End If
    Next
    Application.quit

+ 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. Replies: 3
    Last Post: 01-19-2006, 02:45 PM
  2. How do you insert an "or" operator in an "IF" statement.
    By Max in forum Excel Formulas & Functions
    Replies: 50
    Last Post: 09-06-2005, 07:05 PM
  3. [SOLVED] How do you insert an "or" operator in an "IF" statement.
    By Jim C. in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 AM
  4. How do you insert an "or" operator in an "IF" statement.
    By Jim C. in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. [SOLVED] How do you insert an "or" operator in an "IF" statement.
    By Jim C. in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM

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