Results 1 to 7 of 7

Thread: IF Unique line
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Nov 2009
    Posts
    217
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default IF Unique line

    Hi

    'Alternative to vba Code
    Code:
        If pos = 2 Then pos = 3
        If pos = 5 Then pos = 6
        If pos = 34 Then pos = 35
    Thanks

  2. #2
    Board Regular arthurbr's Avatar
    Join Date
    Dec 2006
    Location
    Belgium
    Posts
    1,890
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: IF Unique line

    Your question being??
    Please,always use a relevant keyword thread title that describes what you are trying to do
    Using XL2003 - 2010

  3. #3
    Board Regular
    Join Date
    Nov 2009
    Posts
    217
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: IF Unique line

    Hi,


    How can I create an alternative code with a single line of code
    Example:

    Code:
    If pos = 2 Or pos = 5 Then pos = pos + 1' More..
    Last edited by ISY; Jan 11th, 2019 at 03:54 AM.

  4. #4
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,392
    Post Thanks / Like
    Mentioned
    471 Post(s)
    Tagged
    47 Thread(s)

    Default Re: IF Unique line

    You already have it as one line of code.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  5. #5
    Board Regular
    Join Date
    Nov 2009
    Posts
    217
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: IF Unique line

    Hi, yes

    I was looking for alternatives to obfuscate the code

  6. #6
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,392
    Post Thanks / Like
    Mentioned
    471 Post(s)
    Tagged
    47 Thread(s)

    Default Re: IF Unique line

    I don't see the point in doing that sort of thing, as it just makes it harder to maintain if you ever need to modify it.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  7. #7
    New Member
    Join Date
    Jul 2019
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: IF Unique line

    this is just complicating thing, not an alternative to anything...

    If you want to make your code hard to understand, obfuscating the variable name may be better approach...

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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