how do centre and Italic the text in a msgbox? Are my

Qroozn

Well-known Member
Joined
Mar 12, 2002
Messages
543
I think the Subject explains what i want.

Any assistance gr8ly appreciated.
This message was edited by Qroozn on 2002-04-23 21:31
This message was edited by Qroozn on 2002-04-23 21:32
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi there
Since no-one else has replied I'll pass on the little I know.
I think text format for message boxes is not easy to write into a macro. You can change the font format by clicking the Start button, then Settings, Control Panel, Display, Appearance tab, Item drop down box and select Message Box. (Buttons for bold or italics are to the right of the drop down box in Windows 2000).
You might find this formatting may also be picked up elsewhere in your spreadsheet besides message box.
The only way I know to centralise is trial and error using spaces at the beginning of the text. You can break the text into separate lines using "& vbCrLf &"

regards
Derek
 
Upvote 0
I did this last week with somebody *?* :wink:
Can you check the archives please,it should be there.
the best of luck to you
 
Upvote 0
Alternativelly you might try something like this, using a text box:

ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 192.75, 75.75, _
239.25, 140.25).Select
Selection.Characters.Text = "Message Box" & Chr(10) & "" & Chr(10) & "Save this file before exiting."
Selection.HorizontalAlignment = xlCenter
Selection.ShapeRange.ScaleHeight 0.58, msoFalse, msoScaleFromTopLeft
Selection.Characters.Text = "Message Box" & Chr(10) & "" & Chr(10) & "Save this file before exiting."
With Selection.Characters(Start:=1, Length:=13).Font
.Name = "Georgia"
.FontStyle = "Bold"
.Size = 20
.ColorIndex = 3
End With
With Selection.Characters(Start:=14, Length:=30).Font
.Name = "Monotype Corsiva"
.FontStyle = "Bold"
.Size = 14
.ColorIndex = xlAutomatic
End With
Selection.ShapeRange.Fill.PresetTextured msoTextureBouquet
Application.Wait Now + TimeValue("00:00:05")
Selection.Delete
Range("A1").Select
End Sub

regards
Derek
This message was edited by Derek on 2002-04-24 00:32
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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