message box help

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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.
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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>
 
Upvote 0
Thanks, Ivan. LOL, I see what you mean. Might be fun to play with it though, could blow some peoples minds.
 
Upvote 0

Forum statistics

Threads
1,215,176
Messages
6,123,464
Members
449,100
Latest member
sktz

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
Back
Top