msgbox Vs MsgBox

JeffGrant

Well-known Member
Joined
Apr 7, 2021
Messages
516
Office Version
  1. 365
Platform
  1. Windows
Hi All, for some reason, I noticed today that every occurrence of the function MsgBox appears in my VBA Code as msgbox and is no longer coloured in Blue as a reserved word.

It does not seem to affect the functionality of the code, but is very strange.

Has anybody else seen this and how can I get it back to what it was?

There is no Dim msgbox in any of my code. Looks like the compiler is doing this all on its own.

Any ideas?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Perhaps there was a variable/routine/module called msgbox. To rectify try adding a declaration of Dim MsgBox and then delete it again.
 
Upvote 0
Solution
Hi Rory,

I put in a Public MsgBox as String statement, saved the file, then deleted the Public MsgBox as String declaration.
In every module, the function now appears as MsgBox. Thanks for that.
What happened though?

Please correct me if I am wrong, but isn't the function MsgBox also supposed to be blue?
 
Upvote 0
It should be whatever colour you have set for Identifier text
 
Upvote 0
Ah Ha....worked it out. Apparently the inbuild function text colour has changed some how, not the identifier text colour. Because the colour of other inbuilt functions such as InputBox, Ucase etc has also changed.

I cant see where to reset it, so as long as it doesn't affect the coding, it is not important.

thanks
 
Upvote 0
The colour for functions is the identifier text colour.
 
Upvote 0

Forum statistics

Threads
1,215,079
Messages
6,122,998
Members
449,092
Latest member
masterms

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