Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default little mistery..

this works........

If aWS.Range("D27").Value = "0" And aWS.Range("P2").Value = "1" And
aWS.Range("C10") = True And aWS.Range("C9") = True And aWS.Range("G9") = True
And aWS.Range("G13") = True And aWS.Range("G2").Value < "0" And
aWS.Range("N1").Value = "1" And aWS.Range("R12").Value
aWS.Range("N2").Value Then
aWS.Range("H9") = True
Else
aWS.Range("H9") = False
End If

If aWS.Range("H9") = True Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If

................if i cut the H9 passage..and write directly H11 it dosn't
work , not writing 1 when it's the time !!!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default little mistery..

Are you saying

aWS.Range("H9") = True
aWS.Range("H11").Value = aWS.Range("H9")

Were you expecting the results in H11 to be 1?

True and False in Basic are not stored as 1 and 0 like in some computer
languages.

It can be converted using Evaluate with this code. evaluate runs the code
as if it was on the worksheet.

Set aWS = ActiveSheet
aWS.Range("H9") = True
aWS.Range("H11").Value = Application.Evaluate("--(" & aWS.Name & "!H9)")

On the worksheet the -- converts True and False to 1 or 0.

This is equavalent to
aWS.Range("H11").Value = Application.Evaluate("--(sheet1!H9)")


"pls123" wrote:

this works........

If aWS.Range("D27").Value = "0" And aWS.Range("P2").Value = "1" And
aWS.Range("C10") = True And aWS.Range("C9") = True And aWS.Range("G9") = True
And aWS.Range("G13") = True And aWS.Range("G2").Value < "0" And
aWS.Range("N1").Value = "1" And aWS.Range("R12").Value
aWS.Range("N2").Value Then
aWS.Range("H9") = True
Else
aWS.Range("H9") = False
End If

If aWS.Range("H9") = True Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If

...............if i cut the H9 passage..and write directly H11 it dosn't
work , not writing 1 when it's the time !!!!!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default little mistery..

my goal is tho have the cell with 0-1...


when i write this it doesn't work...

if "all my things happen" Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If


when i write this it works!!

if "all my things happen" Then
aWS.Range("H9") = True
Else
aWS.Range("H9") = False
End If
If aWS.Range("H9") = True Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If











"Joel" wrote:

Are you saying

aWS.Range("H9") = True
aWS.Range("H11").Value = aWS.Range("H9")

Were you expecting the results in H11 to be 1?

True and False in Basic are not stored as 1 and 0 like in some computer
languages.

It can be converted using Evaluate with this code. evaluate runs the code
as if it was on the worksheet.

Set aWS = ActiveSheet
aWS.Range("H9") = True
aWS.Range("H11").Value = Application.Evaluate("--(" & aWS.Name & "!H9)")

On the worksheet the -- converts True and False to 1 or 0.

This is equavalent to
aWS.Range("H11").Value = Application.Evaluate("--(sheet1!H9)")


"pls123" wrote:

this works........

If aWS.Range("D27").Value = "0" And aWS.Range("P2").Value = "1" And
aWS.Range("C10") = True And aWS.Range("C9") = True And aWS.Range("G9") = True
And aWS.Range("G13") = True And aWS.Range("G2").Value < "0" And
aWS.Range("N1").Value = "1" And aWS.Range("R12").Value
aWS.Range("N2").Value Then
aWS.Range("H9") = True
Else
aWS.Range("H9") = False
End If

If aWS.Range("H9") = True Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If

...............if i cut the H9 passage..and write directly H11 it dosn't
work , not writing 1 when it's the time !!!!!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default little mistery..

i dont use anymore 1-0 but only true-false..but the mistery is still alive !!
bbyyyy




"pls123" wrote:

my goal is tho have the cell with 0-1...


when i write this it doesn't work...

if "all my things happen" Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If


when i write this it works!!

if "all my things happen" Then
aWS.Range("H9") = True
Else
aWS.Range("H9") = False
End If
If aWS.Range("H9") = True Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If











"Joel" wrote:

Are you saying

aWS.Range("H9") = True
aWS.Range("H11").Value = aWS.Range("H9")

Were you expecting the results in H11 to be 1?

True and False in Basic are not stored as 1 and 0 like in some computer
languages.

It can be converted using Evaluate with this code. evaluate runs the code
as if it was on the worksheet.

Set aWS = ActiveSheet
aWS.Range("H9") = True
aWS.Range("H11").Value = Application.Evaluate("--(" & aWS.Name & "!H9)")

On the worksheet the -- converts True and False to 1 or 0.

This is equavalent to
aWS.Range("H11").Value = Application.Evaluate("--(sheet1!H9)")


"pls123" wrote:

this works........

If aWS.Range("D27").Value = "0" And aWS.Range("P2").Value = "1" And
aWS.Range("C10") = True And aWS.Range("C9") = True And aWS.Range("G9") = True
And aWS.Range("G13") = True And aWS.Range("G2").Value < "0" And
aWS.Range("N1").Value = "1" And aWS.Range("R12").Value
aWS.Range("N2").Value Then
aWS.Range("H9") = True
Else
aWS.Range("H9") = False
End If

If aWS.Range("H9") = True Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If

...............if i cut the H9 passage..and write directly H11 it dosn't
work , not writing 1 when it's the time !!!!!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default little mistery..

This would work

MyTruth = "all my things happen"
aWS.Range("H11").Value = evaluate("--("&MyTruth&")")


Where Mytruth equals either True or false.

"pls123" wrote:

i dont use anymore 1-0 but only true-false..but the mistery is still alive !!
bbyyyy




"pls123" wrote:

my goal is tho have the cell with 0-1...


when i write this it doesn't work...

if "all my things happen" Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If


when i write this it works!!

if "all my things happen" Then
aWS.Range("H9") = True
Else
aWS.Range("H9") = False
End If
If aWS.Range("H9") = True Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If











"Joel" wrote:

Are you saying

aWS.Range("H9") = True
aWS.Range("H11").Value = aWS.Range("H9")

Were you expecting the results in H11 to be 1?

True and False in Basic are not stored as 1 and 0 like in some computer
languages.

It can be converted using Evaluate with this code. evaluate runs the code
as if it was on the worksheet.

Set aWS = ActiveSheet
aWS.Range("H9") = True
aWS.Range("H11").Value = Application.Evaluate("--(" & aWS.Name & "!H9)")

On the worksheet the -- converts True and False to 1 or 0.

This is equavalent to
aWS.Range("H11").Value = Application.Evaluate("--(sheet1!H9)")


"pls123" wrote:

this works........

If aWS.Range("D27").Value = "0" And aWS.Range("P2").Value = "1" And
aWS.Range("C10") = True And aWS.Range("C9") = True And aWS.Range("G9") = True
And aWS.Range("G13") = True And aWS.Range("G2").Value < "0" And
aWS.Range("N1").Value = "1" And aWS.Range("R12").Value
aWS.Range("N2").Value Then
aWS.Range("H9") = True
Else
aWS.Range("H9") = False
End If

If aWS.Range("H9") = True Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If

...............if i cut the H9 passage..and write directly H11 it dosn't
work , not writing 1 when it's the time !!!!!



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default little mistery..

ty joel i will work on it

"Joel" wrote:

This would work

MyTruth = "all my things happen"
aWS.Range("H11").Value = evaluate("--("&MyTruth&")")


Where Mytruth equals either True or false.

"pls123" wrote:

i dont use anymore 1-0 but only true-false..but the mistery is still alive !!
bbyyyy




"pls123" wrote:

my goal is tho have the cell with 0-1...


when i write this it doesn't work...

if "all my things happen" Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If


when i write this it works!!

if "all my things happen" Then
aWS.Range("H9") = True
Else
aWS.Range("H9") = False
End If
If aWS.Range("H9") = True Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If











"Joel" wrote:

Are you saying

aWS.Range("H9") = True
aWS.Range("H11").Value = aWS.Range("H9")

Were you expecting the results in H11 to be 1?

True and False in Basic are not stored as 1 and 0 like in some computer
languages.

It can be converted using Evaluate with this code. evaluate runs the code
as if it was on the worksheet.

Set aWS = ActiveSheet
aWS.Range("H9") = True
aWS.Range("H11").Value = Application.Evaluate("--(" & aWS.Name & "!H9)")

On the worksheet the -- converts True and False to 1 or 0.

This is equavalent to
aWS.Range("H11").Value = Application.Evaluate("--(sheet1!H9)")


"pls123" wrote:

this works........

If aWS.Range("D27").Value = "0" And aWS.Range("P2").Value = "1" And
aWS.Range("C10") = True And aWS.Range("C9") = True And aWS.Range("G9") = True
And aWS.Range("G13") = True And aWS.Range("G2").Value < "0" And
aWS.Range("N1").Value = "1" And aWS.Range("R12").Value
aWS.Range("N2").Value Then
aWS.Range("H9") = True
Else
aWS.Range("H9") = False
End If

If aWS.Range("H9") = True Then
aWS.Range("H11").Value = "1"
Else
aWS.Range("H11").Value = "0"
End If

...............if i cut the H9 passage..and write directly H11 it dosn't
work , not writing 1 when it's the time !!!!!

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
Excel 2003 Filtering Mistery Marilyn Excel Discussion (Misc queries) 8 June 12th 09 08:05 PM
Mistery digits on excel Bewilder Excel Discussion (Misc queries) 2 October 5th 05 06:28 PM
Help with emails from Excel-add via Outlook 2003 (mistery apostrophs) qwer[_2_] Excel Programming 0 January 24th 05 01:43 PM


All times are GMT +1. The time now is 06:52 AM.

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

About Us

"It's about Microsoft Excel"