Hi,
So i have 10 buttons on my userform and if i press them i need to find some data according to the button pressed. All the 10 buttons have 1 thing in common they all need the Date, Yearnumber, Montnumber and weeknumber
I could copy the code below 10 times but i wan't to make some sort of Function or subprocedure so whatever button i press it always calculate the date, yearNumber, MonthNumber and the weeknumber
I just don't understand how to do this, i'm quite new to this
Thanks in advance
So i have 10 buttons on my userform and if i press them i need to find some data according to the button pressed. All the 10 buttons have 1 thing in common they all need the Date, Yearnumber, Montnumber and weeknumber
I could copy the code below 10 times but i wan't to make some sort of Function or subprocedure so whatever button i press it always calculate the date, yearNumber, MonthNumber and the weeknumber
I just don't understand how to do this, i'm quite new to this
Code:
Public Datum As Date 'the current Date
Public DatumMaand As Single 'number of the Month
Public DatumWeek As Single 'number of the week
Public DatumJaar As Single 'Number of the Year
Datum = Date
DatumMaand = Month(Datum)
DatumWeek = DatePart("ww", Datum, vbMonday, vbFirstFourDays)
DatumJaar = DatePart("YYYY", Datum, vbMonday, vbFirstFourDays)
Thanks in advance