Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default vbYesNo, change carriage return

Hie, can anyone help with the following:

When you create a message box using vbYesNo function, when the box appears
on screen, is it possible to change the set-up so that when you press return
(carriage return) it will automatically select the "No" option. Standard
vbYesNo defaults to "Yes" option when you hit carriage return.

Any help would be much appreciated.

Thank you
--
jj
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default vbYesNo, change carriage return

Put this macro in a General Module and run it:

Sub MsgBoxButtonTest()
MsgBox _
Title:="Default Button Test", _
Prompt:="Is this an aardvark?", _
Buttons:=vbQuestion + vbYesNo + vbDefaultButton2
End Sub

Then see Excel VBA Help for MsgBox and study the various Button argument
values.

Does that help?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)

"jbjtc" wrote in message
...
Hie, can anyone help with the following:

When you create a message box using vbYesNo function, when the box appears
on screen, is it possible to change the set-up so that when you press
return
(carriage return) it will automatically select the "No" option. Standard
vbYesNo defaults to "Yes" option when you hit carriage return.

Any help would be much appreciated.

Thank you
--
jj



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default vbYesNo, change carriage return


MsgBox "Message Text", vbYesNo + vbDefaultButton2, "Titlebar Text"
--
Kevin Backmann


"jbjtc" wrote:

Hie, can anyone help with the following:

When you create a message box using vbYesNo function, when the box appears
on screen, is it possible to change the set-up so that when you press return
(carriage return) it will automatically select the "No" option. Standard
vbYesNo defaults to "Yes" option when you hit carriage return.

Any help would be much appreciated.

Thank you
--
jj

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default vbYesNo, change carriage return

Thanks Kevin
Thats done the trick.
--
jj


"Kevin B" wrote:


MsgBox "Message Text", vbYesNo + vbDefaultButton2, "Titlebar Text"
--
Kevin Backmann


"jbjtc" wrote:

Hie, can anyone help with the following:

When you create a message box using vbYesNo function, when the box appears
on screen, is it possible to change the set-up so that when you press return
(carriage return) it will automatically select the "No" option. Standard
vbYesNo defaults to "Yes" option when you hit carriage return.

Any help would be much appreciated.

Thank you
--
jj

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default vbYesNo, change carriage return

Your code works.
Thanks for your help Ron
--
jj


"Ron Coderre" wrote:

Put this macro in a General Module and run it:

Sub MsgBoxButtonTest()
MsgBox _
Title:="Default Button Test", _
Prompt:="Is this an aardvark?", _
Buttons:=vbQuestion + vbYesNo + vbDefaultButton2
End Sub

Then see Excel VBA Help for MsgBox and study the various Button argument
values.

Does that help?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)

"jbjtc" wrote in message
...
Hie, can anyone help with the following:

When you create a message box using vbYesNo function, when the box appears
on screen, is it possible to change the set-up so that when you press
return
(carriage return) it will automatically select the "No" option. Standard
vbYesNo defaults to "Yes" option when you hit carriage return.

Any help would be much appreciated.

Thank you
--
jj




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
Carriage Return Freddo Excel Worksheet Functions 2 March 22nd 07 10:34 AM
Hiding carriage return Abe Excel Discussion (Misc queries) 1 February 20th 06 09:58 PM
Strip carriage return, add row adin Excel Worksheet Functions 18 April 26th 05 10:03 AM
Carriage Return in Excel Rod Behr Excel Discussion (Misc queries) 4 December 14th 04 01:53 PM
automatic carriage return Tbledsoe Excel Worksheet Functions 3 December 2nd 04 09:34 PM


All times are GMT +1. The time now is 12:58 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"