From 1e406778964b1b05cc5f80a2c84a5b899533ec1a Mon Sep 17 00:00:00 2001 From: Casielim Date: Mon, 7 Jul 2025 15:54:34 +0800 Subject: [PATCH] Create a form and make the form applicable to all personnel list --- VBA/VBA-Code_By_Modules/frmSpecificDays.frm | 87 ++++++++++++++++++++ VBA/VBA-Code_By_Modules/frmSpecificDays.frx | Bin 0 -> 3608 bytes 2 files changed, 87 insertions(+) create mode 100644 VBA/VBA-Code_By_Modules/frmSpecificDays.frm create mode 100644 VBA/VBA-Code_By_Modules/frmSpecificDays.frx diff --git a/VBA/VBA-Code_By_Modules/frmSpecificDays.frm b/VBA/VBA-Code_By_Modules/frmSpecificDays.frm new file mode 100644 index 0000000..0f2b9c3 --- /dev/null +++ b/VBA/VBA-Code_By_Modules/frmSpecificDays.frm @@ -0,0 +1,87 @@ +VERSION 5.00 +Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} frmSpecificDays + Caption = "Select Specific Days" + ClientHeight = 3120 + ClientLeft = 110 + ClientTop = 460 + ClientWidth = 6010 + OleObjectBlob = "frmSpecificDays.frx":0000 + StartUpPosition = 1 'CenterOwner +End +Attribute VB_Name = "frmSpecificDays" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Public targetSheetName As String + +Private Sub chkMon_Click() + +End Sub + +Private Sub chkSat_Click() + +End Sub + +Private Sub chkWed_Click() + +End Sub + +Private Sub commandCancel_Click() + Dim currentDays As String + currentDays = Trim(ThisWorkbook.Sheets(targetSheetName).Range("D8").Value) + + If currentDays = "" Then + MsgBox "Please select at least one day before proceeding.", vbExclamation + Else + ' Keep existing selection and hide the form + Me.Hide + End If +End Sub +Private Sub commandOK_Click() + Dim selectedDays As String + Dim firstDay As Boolean + + firstDay = True + If chkMon.Value Then + selectedDays = "Mon" + firstDay = False + End If + If chkTues.Value Then + If Not firstDay Then selectedDays = selectedDays & ", " + selectedDays = selectedDays & "Tue" + firstDay = False + End If + If chkWed.Value Then + If Not firstDay Then selectedDays = selectedDays & ", " + selectedDays = selectedDays & "Wed" + firstDay = False + End If + If chkThurs.Value Then + If Not firstDay Then selectedDays = selectedDays & ", " + selectedDays = selectedDays & "Thu" + firstDay = False + End If + If chkFri.Value Then + If Not firstDay Then selectedDays = selectedDays & ", " + selectedDays = selectedDays & "Fri" + firstDay = False + End If + If chkSat.Value Then + If Not firstDay Then selectedDays = selectedDays & ", " + selectedDays = selectedDays & "Sat" + firstDay = False + End If + + If selectedDays = "" Then + MsgBox "Please select at least one day.", vbExclamation + Else + ThisWorkbook.Sheets(targetSheetName).Range("D8").Value = selectedDays + Me.Hide + End If +End Sub + +Private Sub UserForm_Click() + +End Sub + diff --git a/VBA/VBA-Code_By_Modules/frmSpecificDays.frx b/VBA/VBA-Code_By_Modules/frmSpecificDays.frx new file mode 100644 index 0000000000000000000000000000000000000000..aac04e6bedea4218d5ef6f6856d9407d7f5f976e GIT binary patch literal 3608 zcmeHKJxo(k6#iaY{sgr}Ajs4Z1~i7C!2}lv2@E1>g+^8%Z3!Ul)BX&^7~kloZVqB% z986q@PL52PIG~e@4k~do(ZN;f_r3d?R!y4%E+oC=+;iW(=bn4+Io~~}T)NN>9D&yk zvA@y}T;=z>w~I_H9KTJ-{=} zUyM~N+3bz)9Q*#k3UYE&U}IY}Y|nj&S*U!zc%zD*_=(JEbVCg}o^MH&?$qe{@>5(L zn}rGbKZEOtVF4>Lwu9vXgoe=G74A};^?G{9aSK>I0o?A@hiSpt?aupmw<7D?eAm-2FAF#K zEO*>OYrp^vsDmWnygiFNh$ zU|3Ol9a_5sTC0r`+=xf`cES*CJVCXbWaDzd(}ZEW#h z1S79KHJZf=5M+T+*898mALpK#0AE4sK5W7Z3af0tjtu literal 0 HcmV?d00001