Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
increment operator?
Is there a shorthand increment operator ?
eg something like : Inc(long.variable.name) which would be easier to read than long.variable.name = long.variable.name + 1 Also decrement too. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
increment operator?
You could create one...
lngNum = AddOne(lngNum) Function AddOne(ByVal lngN As Long) As Long AddOne = lngN + 1 End Function -or- Call AddOne(lngNum) Function AddOne(ByRef lngN As Long) lngN = lngN + 1 End Function ----------- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Peter Morris" <nospam.ple@se wrote in message Is there a shorthand increment operator ? eg something like : Inc(long.variable.name) which would be easier to read than long.variable.name = long.variable.name + 1 Also decrement too. |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
increment operator?
eg something like :
Inc(long.variable.name) Excel vba doesn't have the ++n operator as in some other programs. Another option similar to Jim's but without parenthesis might be: Function Inc(ByRef n) '// Increment by +1 n = n + 1 End Function Sub Example() Dim long_variable_name long_variable_name = 10 Inc long_variable_name End Sub -- HTH :) Dana DeLouis Windows XP & Office 2003 "Peter Morris" <nospam.ple@se wrote in message . uk... Is there a shorthand increment operator ? eg something like : Inc(long.variable.name) which would be easier to read than long.variable.name = long.variable.name + 1 Also decrement too. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
'Scroll bar' - to increment btwn MIN and MAX value. | Charts and Charting in Excel | |||
check cell val, increment val | Excel Worksheet Functions | |||
need to increment value | Excel Discussion (Misc queries) | |||
Relative reference autofill increment other than +1 | Excel Discussion (Misc queries) | |||
"OR" operator to evaluate multiple conditions | Excel Worksheet Functions |