MsgBox date

  • Thread starter Thread starter IRMA MENDOSA
  • Start date Start date
I

IRMA MENDOSA

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
 
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.
 
Hi Irma,

In fact my original suggestion (vbMonday) responds to your request:
how can I make this to open every Monday of every week

My suggested revision (vbSunday) responds to the requirement implied in
youur message text:
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top