Pop Up Box

  • Thread starter Thread starter Graham
  • Start date Start date
G

Graham

Hi ,

I would like to have a pop up box appear when a certain
limit is reached and then subsequently every time the SS
is openend until the criterea is reduced..

For example..

Cell A1 has sum of all cell showing next Mel Visit

If it reaches 10 or more I would ike a pop up to say "
Please arrange Mel visit "

Cell A2 has sum of a cells showing next Bris visit

If it reaches 10 or more I would like the pop up to
say "please arrange Bris visit"

If both cells reach 10+ I would like one pop up to
say "please arrange Mel & Bris visit".

I am a macro novice so please explain to me like I am a 5
years old !!

Thanks in advance - this is very , very helpful to me
everytime i get a reply
 
Hi
the following macro will show a popup box each time the file is opened.
To enter the code:
- first open your workbook
- hit ALT-F11 to open the VBA editor
- in the left part of the window is an explorer like treeview.
- In this project window locate your file/project and locate the entry
'ThisWorkbook'
- double-click on 'ThisWorkbook'
- In the openening editor window paste the code find below
- close the VBA editor and save your workbook


public sub workbook_open()
Dim melvisit
Dim brisvist
dim smsg

with me.worksheets("sheet1")
melvisit=.range("A1").value
brisvisit=.range("A2").value
end with

if melvisit>=10 and brisvisit>=10 then
smsg="please arrange Mel & Bris visit"
elseif melvisit>=10 then
smsg="please arrange Mel visit"
elseif brisvisit>=10 then
smsg="please arrange Bris visit"
end if

if smsg<>"" then
msgbox smsg
end if

end sub
 
Back
Top