#1   Report Post  
Posted to microsoft.public.excel.misc
Jeff
 
Posts: n/a
Default VBA Boolean

Hi

In VBA I set

X = (J<15)*8

where J=10, so the statement is true, but "X" is set = to "-8"
if True = 1 why is the 8 negative?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Andy Pope
 
Posts: n/a
Default VBA Boolean

Hi,

Because TRUE, in this case, equates to -1
Try this in the immediate window.

?int((10<15))

Cheers
Andy

Jeff wrote:
Hi

In VBA I set

X = (J<15)*8

where J=10, so the statement is true, but "X" is set = to "-8"
if True = 1 why is the 8 negative?


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
Reply
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 can I insert a macro into a boolean statement Garrett Excel Worksheet Functions 1 December 29th 05 03:46 PM
Comparing text and returning boolean values nicoleeee Excel Discussion (Misc queries) 9 December 2nd 05 10:43 AM
Using boolean function for color fill Kanchi Excel Worksheet Functions 2 September 7th 05 01:19 AM
Boolean Find Bill Excel Discussion (Misc queries) 2 May 31st 05 10:52 PM
Boolean masks Howard Excel Worksheet Functions 2 April 3rd 05 08:22 PM


All times are GMT +1. The time now is 12:11 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"