ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MsgBox date (https://www.excelbanter.com/excel-programming/370751-msgbox-date.html)

IRMA MENDOSA[_3_]

MsgBox date
 
How can I make to open this every day 3 of every month on every day
automatic when I open sheet3

and also how can I make this to open every Monday of every week

Thanks in advance



Sub showContentcell()
'MsgBox "Cell A1 = " & Range("A1").Text
MsgBox "Dia Domingo" _
& Chr(13) & Range("F10").Text _
& Chr(13) & Range("F11").Text _
& Chr(13) & Range("F12").Text _
& Chr(13) & Range("F13").Text _
& Chr(13) & Range("F14").Text _


End Sub



Norman Jones

MsgBox date
 
Hi Irma,

Try:

'=============
Private Sub Workbook_Open()
Dim msg As String
Const sStr1 = "Es el tercer día del mes"
Const sStr2 = "Dia Domingo"

msg = Chr(13) & Range("F10").Text _
& Chr(13) & Range("F11").Text _
& Chr(13) & Range("F12").Text _
& Chr(13) & Range("F13").Text _
& Chr(13) & Range("F14").Text

If Day(Date) = 3 Then
MsgBox sStr1 & msg
ElseIf Weekday(Date) = vbMonday Then
MsgBox sStr2 & msg
End If
End Sub
'<<=============

This is workbook event code and should be pasted into the workbook's
ThisWorkbook module *not* a standard module or a sheet module:

Right-click the Excel icon on the worksheet
(or the icon to the left of the File menu if your workbook is maximised)
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.


---
Regards,
Norman


"IRMA MENDOSA" wrote in message
...
How can I make to open this every day 3 of every month on every day
automatic when I open sheet3

and also how can I make this to open every Monday of every week

Thanks in advance



Sub showContentcell()
'MsgBox "Cell A1 = " & Range("A1").Text
MsgBox "Dia Domingo" _
& Chr(13) & Range("F10").Text _
& Chr(13) & Range("F11").Text _
& Chr(13) & Range("F12").Text _
& Chr(13) & Range("F13").Text _
& Chr(13) & Range("F14").Text _


End Sub





Norman Jones

MsgBox date
 
Hi Irma,

ElseIf Weekday(Date) = vbMonday Then


should read:

ElseIf Weekday(Date) = vbSunday Then



---
Regards,
Norman



IRMA MENDOSA[_3_]

MsgBox date
 

How can I make to open this every day 3 of every month on every day
automatic when I open sheet3

and also how can I make this to open every Monday of every week

Thanks in advance



Sub showContentcell()
'MsgBox "Cell A1 = " & Range("A1").Text
MsgBox "Dia Domingo" _
& Chr(13) & Range("F10").Text _
& Chr(13) & Range("F11").Text _
& Chr(13) & Range("F12").Text _
& Chr(13) & Range("F13").Text _
& Chr(13) & Range("F14").Text _


End Sub




All times are GMT +1. The time now is 08:54 AM.

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