LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default boolean to integer

On Tue, 13 Jan 2004 03:49:24 -0800, "sphenisc"
wrote:

Can I convert a boolean expression e.g. (m=2), into a 1 or
0 during a VBA calculation without resorting to if
statements or the like?

Thanks


You can just use it in a mathematical expression and it will convert
automagically.

However, you must be aware that in VBA, FALSE = 0 and TRUE = -1.

So you may want to use a Unary or an ABS function.


--ron


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add an integer to an existing integer? Aaron Excel Worksheet Functions 3 December 17th 09 09:46 PM
IF vs Boolean Brad Excel Discussion (Misc queries) 3 September 4th 09 01:58 AM
boolean question Lisa Excel Worksheet Functions 1 September 5th 08 12:53 PM
More on Boolean Epinn New Users to Excel 7 November 28th 06 09:29 AM
VBA Boolean Jeff Excel Discussion (Misc queries) 1 February 2nd 06 10:01 PM


All times are GMT +1. The time now is 07:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"