Home > Software engineering >  Vb small white, people!
Vb small white, people!

Time:09-15

Input month, year, calls for weekday output date of the week, ask tall person to give directions, thanks.

CodePudding user response:

Try this code:
 Dim datInput As Date 
DatInput=InputBox (" please enter the date (month, day, year) : ")

Dim intResult As Integer
IntResult=Weekday (datInput vbMonday)

MsgBox intResult

CodePudding user response:

Pop up with or object variable is not set
Then if June 21 years use text input how to write?

CodePudding user response:

Code:
 Option Explicit 

Private Sub Command1_Click ()
If Not IsDate (Text1. Text) Then
MsgBox "input error!"
The Else
Dim intResult As Integer
IntResult=Weekday (Text1, vbMonday)

MsgBox intResult
End the If
End Sub

Presentation:

Download address:
Link: https://pan.baidu.com/s/1vvPgjbDKRelwnBVO8TR2MA
The extracted code: 3 u1i

CodePudding user response:

The
reference 3 floor milaoshu1020 response:
code:
 Option Explicit 

Private Sub Command1_Click ()
If Not IsDate (Text1. Text) Then
MsgBox "input error!"
The Else
Dim intResult As Integer
IntResult=Weekday (Text1, vbMonday)

MsgBox intResult
End the If
End Sub

Presentation:

Download address:
Link: https://pan.baidu.com/s/1vvPgjbDKRelwnBVO8TR2MA
Extract the code: 3 u1i

Thank you very much, you can run, thank you bosses!
  • Related