Amin Kaveh
New Member
- Joined
- Jan 17, 2019
- Messages
- 18
Hi
I am designing a calendar with 365 command button as 365 days, and all buttons has same codes in spite of indexes.
Is there any way to have one procedure instead of 365. for example my first day on seventh month procedure is here:
Private Sub day_7_1_Click()
For i = 1 To Sheets.Count
If Worksheets(i).Name = Right(Daily_Report.main_year.Text, 2) & ".07.01" Then
Call Daily_Report.CommandButton_edit_Click
End If
Next i
Daily_Report.Text1_date = Daily_Report.main_year.Value
Daily_Report.Text2_date = "07"
Daily_Report.Text3_date = "01"
End Sub
Thanking you in advance
I am designing a calendar with 365 command button as 365 days, and all buttons has same codes in spite of indexes.
Is there any way to have one procedure instead of 365. for example my first day on seventh month procedure is here:
Private Sub day_7_1_Click()
For i = 1 To Sheets.Count
If Worksheets(i).Name = Right(Daily_Report.main_year.Text, 2) & ".07.01" Then
Call Daily_Report.CommandButton_edit_Click
End If
Next i
Daily_Report.Text1_date = Daily_Report.main_year.Value
Daily_Report.Text2_date = "07"
Daily_Report.Text3_date = "01"
End Sub
Thanking you in advance