![]() |
Msgbox
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.. -- Message posted from http://www.ExcelForum.com |
Msgbox
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 -- Regards Frank Kabel Frankfurt, Germany 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 not work when I open this work book. I want when ever I open workbook and B10 is greater than 0 then it should give me this message... I neeeeeed badly you help please... --- Message posted from http://www.ExcelForum.com/ |
Msgbox
Hi,
I would add that to display on open, it has to be in the on open event i.e. ThisWorkbook_onOpen() -----Original Message----- 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 -- Regards Frank Kabel Frankfurt, Germany 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 not work when I open this work book. I want when ever I open workbook and B10 is greater than 0 then it should give me this message... I neeeeeed badly you help please... --- Message posted from http://www.ExcelForum.com/ . |
Msgbox
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 -----Original Message----- Hi, I would add that to display on open, it has to be in the on open event i.e. ThisWorkbook_onOpen() -----Original Message----- 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 -- Regards Frank Kabel Frankfurt, Germany 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 not work when I open this work book. I want when ever I open workbook and B10 is greater than 0 then it should give me this message... I neeeeeed badly you help please... --- Message posted from http://www.ExcelForum.com/ . . |
All times are GMT +1. The time now is 07:27 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com