Msgbox

  • Thread starter Thread starter pushp
  • Start date Start date
P

pushp

I am trying to have a msgbox in case B10 is greater than 0 (Zero)...

Sub workbook_open()

If Cells(10, 2) > 0 Then
msg = MsgBox("Need investigation.... ", vbOKOnly, "Money Missing")
End If

End Sub

However, this code runs very well when i play from VBE but does no
work when I open this work book. I want when ever I open workbook an
B10 is greater than 0 then it should give me this message...
I neeeeeed badly you help please..
 
Hi
you have to place this code in your workbook module ('ThisWorkbook').
Also you should add the sheet name to your refeerence. e.g.
IF worksheets("sheet1").cells(10,2)>0 then
 
Hi,
I would add that to display on open, it has to be in the
on open event i.e. ThisWorkbook_onOpen()
 
Type the code in the Workbook_Open event.
This sub is an option in the VBA editor and not something
you'd need to create yourself.
As has already been said,you need to specify which sheet
you're referring to and lose the msg


Private Sub Workbook_Open()
if Sheet(sheet name/number).cells(10,2)> 0 then
msgbox "Need investigation....", "Money Missing"
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