ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Message boxes (https://www.excelbanter.com/excel-discussion-misc-queries/54721-message-boxes.html)

JaB

Message boxes
 
Hi there

Does anyone know how to create pop up message boxes? Basically Id like a
box that pops up when a user opens the spreadsheet and asks, 'Update?' with a
'Yes' or'No' selection option.
Ive seen it in other spreadsheets, but not sure how to do it.

Thanks

Bob Phillips

Message boxes
 
Private Sub Workbook_Open()
Dim ans
ans = MsgBox("Update")
If ans = vbYes Then
'do something
End If
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"JaB" wrote in message
...
Hi there

Does anyone know how to create pop up message boxes? Basically Id like a
box that pops up when a user opens the spreadsheet and asks, 'Update?'

with a
'Yes' or'No' selection option.
Ive seen it in other spreadsheets, but not sure how to do it.

Thanks





All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com