#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default 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/


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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/


.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MsgBox Bob Phillips[_6_] Excel Programming 0 April 8th 04 09:11 AM
help with msgbox shirley Excel Programming 3 February 10th 04 04:58 AM
Msgbox Bernd[_2_] Excel Programming 0 October 24th 03 10:20 AM
MsgBox redmad Excel Programming 1 August 1st 03 12:18 AM
MsgBox Dave Peterson[_3_] Excel Programming 0 July 23rd 03 02:11 AM


All times are GMT +1. The time now is 12:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"