vba

S

Squibbly

i want to create a vba routine that tell me the data in a specific cell has
gone over a limit and warn me of it, if it hasnt gone over the limit then
not to warn me
can any1 tell me how this is done
 
M

Max

Maybe a simple IF() will do?

Assume the specific cell is A2, with limit not to exceed 25

Put in say B2: =IF(A2>25,"Alert!","")

B2 will remain blank until the value in A2 exceeds 25,
wherein the phrase "Alert" will appear in B2
 
B

Bob Phillips

I would use conditional formatting for this, not VBA. Just set the condition
to greater than your value and set a pattern colour, and Excel will take
care of it for you.

--

HTH

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

JMay

where cell D3 contains = Sum(A1:A10)

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("D3").Value > 1200 Then
MsgBox ("You are over the $1,200 limit!")
End If
End Sub
 
S

Squibbly

thanks

JMay said:
where cell D3 contains = Sum(A1:A10)

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("D3").Value > 1200 Then
MsgBox ("You are over the $1,200 limit!")
End If
End Sub
 
Top