message box help

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Ivan F Moala

MrExcel MVP
Joined
Feb 10, 2002
Messages
4,209
Yes you can change this via code...only problem is ALL your objects of this type will be changed to this colour. The settings applies to All Windows objects.
 

technix

Active Member
Joined
May 19, 2002
Messages
326
On 2002-09-20 06:40, Ivan F Moala wrote:
Yes you can change this via code...only problem is ALL your objects of this type will be changed to this colour. The settings applies to All Windows objects.

I guess I use the old userform then :) thank you for the quick replies

Derrick
 

elgringo56

Well-known Member
Joined
Apr 15, 2002
Messages
869

ADVERTISEMENT

Ivan, what is the code to do this with? Does it require a good deal of time to run? If not, could one not change the color, then when the message box is responded to, change it back?
On 2002-09-20 06:40, Ivan F Moala wrote:
Yes you can change this via code...only problem is ALL your objects of this type will be changed to this colour. The settings applies to All Windows objects.
 

Ivan F Moala

MrExcel MVP
Joined
Feb 10, 2002
Messages
4,209
On 2002-09-20 07:17, elgringo56 wrote:
Ivan, what is the code to do this with? Does it require a good deal of time to run? If not, could one not change the color, then when the message box is responded to, change it back?
On 2002-09-20 06:40, Ivan F Moala wrote:
Yes you can change this via code...only problem is ALL your objects of this type will be changed to this colour. The settings applies to All Windows objects.

If you run this code you will see what I mean by changing object colours;

<pre/>
Option Explicit

Private Declare Function GetSysColor Lib "user32" ( _
ByVal nIndex As Long) As Long

Private Declare Function SetSysColors Lib "user32" ( _
ByVal nChanges As Long, _
lpSysColor As Long, _
lpColorValues As Long) As Long

Private Const COLOR_BTNFACE = 15

Sub ChangeDefaultColorBtn()
Dim Kolor
Dim CurKolor
'===============================================
'// Black 0 0 0 || Blue 0 0 255
'// Green 0 255 0 || Cyan 0 255 255
'// Red 255 0 0 || Magenta 255 0 255
'// Yellow 255 255 0 || White 255 255 255
'===============================================
CurKolor = GetSysColor(COLOR_BTNFACE) '// 12632256

'// color it Green
Kolor = SetSysColors(1, 15, RGB(0, 255, 0))

MsgBox "Object colours have changed!"

'// Restore to Default
Kolor = SetSysColors(1, COLOR_BTNFACE, CurKolor)


End Sub
</pre>
 

elgringo56

Well-known Member
Joined
Apr 15, 2002
Messages
869
Thanks, Ivan. LOL, I see what you mean. Might be fun to play with it though, could blow some peoples minds.
 

Forum statistics

Threads
1,144,312
Messages
5,723,654
Members
422,508
Latest member
Lordkit1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top