Thread: VBA help
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mike B. Mike B. is offline
external usenet poster
 
Posts: 15
Default VBA help

What I am trying to do is simulate some electronics logic through excel.

Inputs:
C8: comes from a button I created; the button gives the cell a value of 1 or
0. When the button is pressed, it changes the value of the cell from a 1 to a
0 or a 0 to a 1. When there is a value of 1, the word "UNLATCHED" appears
right next to the button. When there is a value of 0, the cell becomes blank.

C9: comes from the output of another card; this cell holds a value of either
a 1 or a 0

Output:
C10: =IF(C8=1,0,IF(C9=1,1,0))

For example:
If at any time C8=1 (from the button), the C10 will have a value of 0. The
word "UNLATCHED" will be under the button. The word "LATCHED" will not be
present in D10.

When the button is pressed, C8 goes to 0. "UNLATCHED" disappears. If C9 is
0, nothing happens. "LATCHED" is not present as well.

When C9 is 1, C10 has a value of 1 and the word "LATCHED" appears in D10.

Next, when C9 goes back to 0, C10 goes back to 0, but the word "LATCHED" is
still present.

Finally, when the button is pressed to give C8 the value of 1, C10 has a
value of 0, "LATCHED disappears, and "UNLATCHED" reappears underneath the
button.

Hope this helps.

"A Mad Doberman" wrote:

On Jun 23, 1:38 pm, Mike B. wrote:
In excel:

Inputs:
C8-- button can change value to 1 or 0
C9-- =A3 (which can either be a 1 or 0)

Output:
C10-- =IF(C8=1,0,IF(C9=1,1,0))

Dilemma:
When C10 is equal to 1, I want D10 to read "LATCHED". However, when C10
turns back into a 0 by changing the inputs, I want D10 to still read
"LATCHED". I want to be able to do this without buttons, requiring the use of
Worksheet_Change or something manner which I have no idea about.

Thanks in advance


without a more detailed description of your conditions, it's difficult
to help. However, it seems like you could accomplish what you are
describing by adding AND conditions to your IF statement. Basically,
this would simply require more than 1 condition to be true before
something changed.