#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default message box


hi,
can please send me the proper syntax for message box...my code doesn'
seem to work.
thans

--
tweety12
-----------------------------------------------------------------------
tweety127's Profile: http://www.excelforum.com/member.php...fo&userid=3467
View this thread: http://www.excelforum.com/showthread.php?threadid=54597

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default message box

What doesn't work?

Go the VBA help
Type in: msgbox function
Pick the first
All will be explained.

RBS

"tweety127" wrote
in message ...

hi,
can please send me the proper syntax for message box...my code doesn't
seem to work.
thansk


--
tweety127
------------------------------------------------------------------------
tweety127's Profile:
http://www.excelforum.com/member.php...o&userid=34673
View this thread: http://www.excelforum.com/showthread...hreadid=545970


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default message box

See help in VBA, it's all explained there.

--
HTH

Bob Phillips

(replace somewhere in email address with googlemail if mailing direct)

"tweety127" wrote
in message ...

hi,
can please send me the proper syntax for message box...my code doesn't
seem to work.
thansk


--
tweety127
------------------------------------------------------------------------
tweety127's Profile:

http://www.excelforum.com/member.php...o&userid=34673
View this thread: http://www.excelforum.com/showthread...hreadid=545970



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,316
Default message box


MsgBox Prompt, Command Buttons (Optional), Title Bar (Optional)

MsgBox "You can't get there from here.",vbOKOnly,"Box Title Bar"

You can get a return value for a variable by declaring the variable and
using the MsgBox function:

dim intYesNo as Integer

intYesNo = MsgBox("Want to Continue?,vbYesNo,"Dialog Box Title")

If you don't provide a command button or title bar the OK command button is
used as the default along with the default title bar for the message box
--
Kevin Backmann


"tweety127" wrote:


hi,
can please send me the proper syntax for message box...my code doesn't
seem to work.
thansk


--
tweety127
------------------------------------------------------------------------
tweety127's Profile: http://www.excelforum.com/member.php...o&userid=34673
View this thread: http://www.excelforum.com/showthread...hreadid=545970


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default message box


here's the code and this is not working.

error message: Expected: =

If Worksheets("sheet5").Range("c6") = " " Then MsgBox("Fill in the
Missing Information!", vbOK, "Warning")

End If
If Worksheets("sheet5").Range("c7") = " " Then MsgBox("Fill in the
Missing Information!", vbOK, "Warning")
End If
If Worksheets("sheet5").Range("c8") = " " Then MsgBox("Fill in the
Missing Information!", vbOK, "Warning")
End If
If Worksheets("sheet5").Range("c9") = " " Then MsgBox("Fill in the
Missing Information!", vbOK, "Warning")
End If


--
tweety127
------------------------------------------------------------------------
tweety127's Profile: http://www.excelforum.com/member.php...o&userid=34673
View this thread: http://www.excelforum.com/showthread...hreadid=545970



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default message box

As you are not using the result of the Msgbox function
you have to take the brackets out, so:

MsgBox "Fill in the Missing Information!", vbOK, "warning"
etc.

Didn't your code show up in red?

RBS

"tweety127" wrote
in message ...

here's the code and this is not working.

error message: Expected: =

If Worksheets("sheet5").Range("c6") = " " Then MsgBox("Fill in the
Missing Information!", vbOK, "Warning")

End If
If Worksheets("sheet5").Range("c7") = " " Then MsgBox("Fill in the
Missing Information!", vbOK, "Warning")
End If
If Worksheets("sheet5").Range("c8") = " " Then MsgBox("Fill in the
Missing Information!", vbOK, "Warning")
End If
If Worksheets("sheet5").Range("c9") = " " Then MsgBox("Fill in the
Missing Information!", vbOK, "Warning")
End If


--
tweety127
------------------------------------------------------------------------
tweety127's Profile:
http://www.excelforum.com/member.php...o&userid=34673
View this thread: http://www.excelforum.com/showthread...hreadid=545970


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default message box

Hello,

I think you should delete the parentheses in the MsgBox function as
follows:

If Worksheets("sheet5").Range("c6") = " " Then
MsgBox "Fill in the Missing Information!", vbOK, "Warning"
Worksheets("sheet5").Range("c6").Select 'Added
Exit Sub 'Added
End If

The "Exit Sub" is added to enable the user to complete the information.

I hope this helps.

Regards,

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default message box


Try putting this in the Worksheet

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim msg, style, title, response

If Sheet5.Range("c5").Value = "" Or _
Sheet5.Range("c7").Value = "" Or _
Sheet5.Range("c8").Value = "" Or _
Sheet5.Range("c9").Value = "" Then
msg = "Please complete the missing information"
title = "Required Information Missing"
style = vbOKOnly + vbExclamation + vbDefaultButton1 +
vbApplicationModal
response = MsgBox(msg, style, title)
End If

End Sub

End Sub


--
ljsmith


------------------------------------------------------------------------
ljsmith's Profile: http://www.excelforum.com/member.php...o&userid=30531
View this thread: http://www.excelforum.com/showthread...hreadid=545970

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default message box


You're Such Of Great Help! Thank

--
tweety12
-----------------------------------------------------------------------
tweety127's Profile: http://www.excelforum.com/member.php...fo&userid=3467
View this thread: http://www.excelforum.com/showthread.php?threadid=54597

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
Replace Excel Message w/Custom Message Kevin R Excel Programming 1 May 18th 06 04:13 PM
Intercept/replace standard 'cell protected' message with my own message? KR Excel Programming 3 March 16th 06 02:31 PM
Opening an attachment of a message that has a message as attachmen vetron Excel Programming 0 January 30th 06 06:17 PM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
Displaying a message in a message box without requiring user to click anything to proceed Android[_2_] Excel Programming 2 June 25th 04 06:44 PM


All times are GMT +1. The time now is 09:07 AM.

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"