vba

  • Thread starter Thread starter Squibbly
  • Start date Start date
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
 
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
 
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)
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top