View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
okrob okrob is offline
external usenet poster
 
Posts: 142
Default MESSAGE BOX IN EXCEL

On Apr 3, 9:21 am, wrote:
Hello,

I have created a spreadsheet with totals on it, the total is a formula
in cell J25, what i am trying to do is each time the total goes over a
limit of £5k, i want a message box to appear and say somethinkg like
seek more approval, also is there a quick way to archive data from a
spreadsheet, so for example if i have popultaed a sheet with 200
records on it, and in column "D", if it has an "I" in it, i want to
create a new tab, and cut and paste all those records onto it but
without affecting my form, I woudl appreacite any help whatsoever
Kind Regards

Zed


In regard to the first part,

Private Sub Worksheet_Change(ByVal Target As Range)
Const ws_Rng As String = "J1:J24" '<== edit if needed
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(ws_Rng)) Is Nothing Then
If [J25].Value 4999.99 Then
MsgBox "Needs Approval"
Else
End If
End If
ws_exit:
Application.EnableEvents = True
End Sub