ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   A question of TARGET.VALUE (https://www.excelbanter.com/excel-programming/298225-question-target-value.html)

PCOR

A question of TARGET.VALUE
 
I am usisng the following code...and it works to a certain extent.
The Commandbutton1, which is normally HIDDEN does become visible if the data
at H2 is greater that 1111
In other words if I type in 1111 at H2 the commandbutton1 will be visible
BUT
if I have a formula in H2 that displays a number great than 1111, the
commandbutton1 does NOT appear.
Can this be fixed.
Thanks
If Target.Address = "$H$2" Then
If Target.Value 1111 Then
CommandButton1.Visible = True

END IF
End If

--
Norton Professional 2004 says this email is clean...believe it



Harald Staff

A question of TARGET.VALUE
 
Probably because you've placed this in the Worksheet_change event (you don't
provide that info, so I'm guessing here). That event does not trig with a
target address when a formula in target recalculates. So find the event that
causes the formula result to change and check there instead.

HTH. Best wishes Harald


"PCOR" skrev i melding
le.rogers.com...
I am usisng the following code...and it works to a certain extent.
The Commandbutton1, which is normally HIDDEN does become visible if the

data
at H2 is greater that 1111
In other words if I type in 1111 at H2 the commandbutton1 will be visible
BUT
if I have a formula in H2 that displays a number great than 1111, the
commandbutton1 does NOT appear.
Can this be fixed.
Thanks
If Target.Address = "$H$2" Then
If Target.Value 1111 Then
CommandButton1.Visible = True

END IF
End If

--
Norton Professional 2004 says this email is clean...believe it





Bob Phillips[_6_]

A question of TARGET.VALUE
 
A change to the cells that the H2 formula is using will not trigger the
Change event. For this you need the calculate event, but you need to have
some checking in there to see if the value of H2 has changed as the
calculate might be triggered by some completely unrelated cells.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"PCOR" wrote in message
le.rogers.com...
I am usisng the following code...and it works to a certain extent.
The Commandbutton1, which is normally HIDDEN does become visible if the

data
at H2 is greater that 1111
In other words if I type in 1111 at H2 the commandbutton1 will be visible
BUT
if I have a formula in H2 that displays a number great than 1111, the
commandbutton1 does NOT appear.
Can this be fixed.
Thanks
If Target.Address = "$H$2" Then
If Target.Value 1111 Then
CommandButton1.Visible = True

END IF
End If

--
Norton Professional 2004 says this email is clean...believe it






All times are GMT +1. The time now is 03:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com