pritom
pritom

Reputation: 3

Visual Basic for Applications Animated text

when I open my excel, macro command run automatically and show "welome".But i want to design it little bit.Is there any way i can change its colour size or text box. below my screen shot. [Its not utmost important but I love to know can i animated this text.] IMAGE LINK https://msexcel-analysistabs1.netdna-ssl.com/wp/wp-content/uploads/2013/01/run-a-macro-automatically.png

Upvotes: 0

Views: 1231

Answers (2)

Aaron Comstock
Aaron Comstock

Reputation: 11

As far as changing the color and size of the text, Yes, you need to create a UserForm and create the 'Welcome' screen as a custom form instead of using VBA's msgbox.

In VBA, right click on the workbook in the Project Explorer.
Select Insert->UserForm.
Design how you'd like the Welcome screen to display.
In ThisWorkbook's Workbook_Open() sub, put UserForm.Show() to display the custom welcome message when the workbook first opens.

As far as animating said text, Not really. There are some convoluted workarounds using an embedded webbrowser object in order to render a custom animated text javascript file. It is full of 'Potential Risk' notifications for the user and really doesn't look very good. Sorry to burst your bubble :).

Upvotes: 1

Busse
Busse

Reputation: 863

Are you just calling a standard msgbox in VBA? If so, instead of calling a msgbox, you can create an actual UserForm in Excel VBA. From there, place a label in the "box" and you can format the font in a variety of ways: colors, size, text font, etc.

You cannot do any "fun" animations as far as I know. But you can definitely change the font size and color!

Here is an example (I'm not the most creative person)

You do this under the VBA Project Explorer -> Insert -> Userform. From there you add Labels/Buttons/Whatever objects you would like, and resize the form if you so choose. Then in your module/macro, you call this form instead of using a msgbox.

Upvotes: 1

Related Questions