Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7436959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:19:22+00:00 2026-05-29T10:19:22+00:00

In my code i want to use if condition. In which i want to

  • 0

In my code i want to use if condition. In which i want to use “OR” around 18 times.
Like for e.g.

If a="something" or a="something" or a="something" or.........(up to 18 times)... then
  'do nothing
else
  'do action
end if

[Note : value of a is changing in For loop every time]
so i just want to ask does there any limitation in IF for using OR in limited times.
OR is there any other better way to do the same.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:19:22+00:00Added an answer on May 29, 2026 at 10:19 am

    As far as I know, there is no limitation when using OR this way.

    Yet, you may consider alternative ways of coding this.

    Negating a condition using Not

    First, if you do nothing in the first case, then consider using the Not statement:

    If Not True Then
    'do somethin
    'no else
    End If
    

    Consider using Select Case

    Second, if you are checking the very same variable, you could either consider using a Select Case but it doesn’t seem appropriate in your case if you have only one case.

    Try to use a search

    Eventually, if you are checking strings, you could probably better use a search within an array (with Application.Match if you are within Excel or .Contains) or within a String using Instr.

    Using a collection or a dictionary

    [EDIT] Another very good way to handle this would be to use the Dictionary Structure of VBA and check if a exists (see MSDN for some information).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use conditional css in my datatable. Here is my code. <ui:repeat
In the following code I want to use the dilate function but I don't
I want use this 1 for using Bar code or QR code scanner. I
I want to use WebKit as the layout/rendering engine, and I want to code
I don't want use old Visual Basic methods in my code, and I'm confused
I have a code base I want to use for both an ASP.NET MVC
I have a java code where I want to use Guava libraries CharMatcher function.
I have an underlying ruby game-engine code and I want to use the web
I want to use code beside files for my views in my ASP.NET MVC
I want to use regions for code folding in Eclipse ; how can that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.