HiHi,
whilst it is possible to do what you want & here is one example how that you can read here:Create Custom Button Labels for a VBA MsgBox - wellsr.com
but there are others who have published similar suggestions you can search for.
Personally, I would just create my own from a Userform which gives you access to each controls properties like, colour, size etc that you can easily change.
Dave
hiHi,
can give it a go - Go to VB editor (Alt+F11) > Insert > UserForm
Create the userform as shown in image with following Controls
Name the userform frmMsgBox
- Two Labels named
PromptLabel
ButtonsPanel
- Three commandButtons named
Button1
Button2
Button3
ENSURE that you name these controls as shown - You should also rename the control captions as shown
while you are doing that will start typing some code - let me know when done.
Dave
View attachment 48743
End If
Path = "g:\Office\test\test123\"
FileName = Range("A1").Value & " " & Range("b1").Value & " " & Format(Now, "mm-dd-yyyy") & ".xlsx"
ActiveWorkbook.SaveAs Path & FileName, xlOpenXMLWorkbook
Dim response As VbMsgBoxResult
Path = "g:\Office\test\test123\"
Filename = Range("A1").Value & " " & Range("b1").Value & " " & Format(Now, "mm-dd-yyyy") & ".xlsx"
response = MsgBox(Filename & Chr(10) & "Do You Want To Save The File?", vbYesNo, "Save File")
If response = vbNo Then Exit Sub
ActiveWorkbook.SaveAs Path & Filename, xlOpenXMLWorkbook
i dont need a msg box i need to be able to have the file name changed acording to the button i press ,so i f the first button is called john then the file name is john with date etc..The standard msgbox returns an integer of value between 1 - 7 depending on which button is selected.
Any form I create would use the Msgbox enumeration - changing the captions would not change the selected buttons value.
E.G. If you selected Button1 as vbYes then Its return value will be 6 but its caption could be anything you decide.
I should also mention I will not be including the Icons.
But before get too deep is this what you are thinking of with standard msgbox?
VBA Code:Dim response As VbMsgBoxResult Path = "g:\Office\test\test123\" Filename = Range("A1").Value & " " & Range("b1").Value & " " & Format(Now, "mm-dd-yyyy") & ".xlsx" response = MsgBox(Filename & Chr(10) & "Do You Want To Save The File?", vbYesNo, "Save File") If response = vbNo Then Exit Sub ActiveWorkbook.SaveAs Path & Filename, xlOpenXMLWorkbook
This will produce msgbox prompt with YesNo buttons
If this is not what you are thinking can you provide more specific code from your project with captions you would want to apply?
Dave
i dont need a msg box i need to be able to have the file name changed acording to the button i press ,so i f the first button is called john then the file name is john with date etc..