IF Unique line

ISY

Active Member
Joined
Nov 16, 2009
Messages
429
Office Version
  1. 365
Platform
  1. Windows
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
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi,


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

Code:
[FONT=arial][COLOR=#212121]If pos = 2 Or pos = 5 Then pos = pos + 1' More..[/COLOR][/FONT]
 
Last edited:
Upvote 0
:confused: You already have it as one line of code.
 
Upvote 0
Hi, yes

I was looking for alternatives to obfuscate the code :)
 
Upvote 0
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.
 
Upvote 0
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...
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top