Behavioral task
behavioral1
Sample
52211541d8cb47134dcb67c14a2c851edfeb5191d489916b2f691b4fe15b312a.doc
Resource
win7-20240221-en
Behavioral task
behavioral2
Sample
52211541d8cb47134dcb67c14a2c851edfeb5191d489916b2f691b4fe15b312a.doc
Resource
win10v2004-20240226-en
General
-
Target
52211541d8cb47134dcb67c14a2c851edfeb5191d489916b2f691b4fe15b312a
-
Size
372KB
-
MD5
cca002334f80fe18f0ea49263f8519aa
-
SHA1
ba6b2d4f9be0421c9b75e07c54c4b6fc88887d94
-
SHA256
52211541d8cb47134dcb67c14a2c851edfeb5191d489916b2f691b4fe15b312a
-
SHA512
d774f35ff4989c156a461b132ed3e7eddf68b8006fd8f3cc38586de89cb45ff2afbb16b373c9f4f6509659441b0e4e819c93798cf72b00b3720f356ca182b088
-
SSDEEP
3072:LvuaXv2UlZoXUS8WbCA9U2xmYhp3y4/20qlGaOlko0uGQWslNXGEqR3RLO3fokwJ:A31YGV0k36+qvvApW+XG
Malware Config
Signatures
-
Office macro that triggers on suspicious action 1 IoCs
Office document macro which triggers in special circumstances - often malicious.
resource yara_rule sample office_macro_on_action -
resource sample
Files
-
52211541d8cb47134dcb67c14a2c851edfeb5191d489916b2f691b4fe15b312a.doc windows office2003
ThisWorkbook
1Attribute VB_Name = "ThisWorkbook"2Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"3Attribute VB_GlobalNameSpace = False4Attribute VB_Creatable = False5Attribute VB_PredeclaredId = True6Attribute VB_Exposed = True7Attribute VB_TemplateDerived = False8Attribute VB_Customizable = True9101112Private Sub Workbook_Open()13Sheet3.Select14End Sub15Sheet1
1Attribute VB_Name = "Sheet1"2Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"3Attribute VB_GlobalNameSpace = False4Attribute VB_Creatable = False5Attribute VB_PredeclaredId = True6Attribute VB_Exposed = True7Attribute VB_TemplateDerived = False8Attribute VB_Customizable = True9Private Sub Worksheet_Activate()10On Error Resume Next11'Cells.EntireRow.AutoFit12Range("B1:Q1").Value = Sheet5.Range("B2:Q2").Value1314i = Sheet2.Range("A65000").End(xlUp).Row15i1 = Range("B65000").End(xlUp).Row + 50016Range("B2:B" & i1).Validation.Delete17Range("B2:B" & i1).Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _18xlBetween, Formula1:="=DanhMuc!$A$2:$A$" & i19'ActiveWindow.DisplayGridlines = False20212223j = Sheet2.Range("B65000").End(xlUp).Row24j1 = Range("G65000").End(xlUp).Row + 50025Range("G2:G" & j1).Validation.Delete262728With Range("G2:G" & j1).Validation29.Add Type:=xlValidateList, AlertStyle:=xlValidAlertWarning, Operator _30:=xlBetween, Formula1:="=DanhMuc!$B$2:$B$" & j31.IgnoreBlank = True32.InCellDropdown = True33.InputTitle = ""34.ErrorTitle = ""35.InputMessage = ""36.ErrorMessage = ""37.ShowInput = False38.ShowError = False39End With404142k = Sheet2.Range("C65000").End(xlUp).Row43k1 = Range("H65000").End(xlUp).Row + 5004445Range("H2:H" & k1).Validation.Delete464748With Range("H2:H" & k1).Validation49.Add Type:=xlValidateList, AlertStyle:=xlValidAlertWarning, Operator _50:=xlBetween, Formula1:="=DanhMuc!$C$2:$C$" & k51.IgnoreBlank = True52.InCellDropdown = True53.InputTitle = ""54.ErrorTitle = ""55.InputMessage = ""56.ErrorMessage = ""57.ShowInput = False58.ShowError = False59End With6061End Sub6263Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)64On Error Resume Next65Set keyRange = Range("K5:P200000")6667If Not Intersect(keyRange, Target) Is Nothing Then6869If Target > 0 Or Target = "" Then7071Call MoFileDinhKem3_KichDup72End If73End If7475'Set keyRange1 = Range("G2:H200000")76'If Not Intersect(keyRange1, Target) Is Nothing Then7778'If ActiveCell.Column = 7 Then79'SaveSetting "QLVB20", "Startup", "TenForm", l_i_i_l_1_l_i_1_1_1_1_l("NGUOOFN VAWN BARN")80'SaveSetting "QLVB20", "Startup", "VungLoc", "B2:B1000"81'l_i_i_1_i_1_l_1_1_l_l_1.Show 182'End If838485'If ActiveCell.Column = 8 Then86'SaveSetting "QLVB20", "Startup", "TenForm", l_i_i_l_1_l_i_1_1_1_1_l("DDAAFU MOOSI XUWR LYS")87'SaveSetting "QLVB20", "Startup", "VungLoc", "C2:C1000"88'l_i_i_1_i_1_l_1_1_l_l_1.Show 189'End If9091'End If92End Sub939495Sheet2
1Attribute VB_Name = "Sheet2"2Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"3Attribute VB_GlobalNameSpace = False4Attribute VB_Creatable = False5Attribute VB_PredeclaredId = True6Attribute VB_Exposed = True7Attribute VB_TemplateDerived = False8Attribute VB_Customizable = True9Private Sub Worksheet_Activate()10On Error Resume Next11Range("A1").Value = Sheet5.Range("B1").Value12Range("B1").Value = Sheet5.Range("C1").Value13Range("C1").Value = Sheet5.Range("D1").Value1415End Sub1617Sheet4
1Attribute VB_Name = "Sheet4"2Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"3Attribute VB_GlobalNameSpace = False4Attribute VB_Creatable = False5Attribute VB_PredeclaredId = True6Attribute VB_Exposed = True7Attribute VB_TemplateDerived = False8Attribute VB_Customizable = True9Private Sub Worksheet_Activate()10On Error Resume Next11ActiveWindow.SmallScroll Down:=-1000012Range("H1").Value = Range("B2").Value13Range("H2").NumberFormat = "General"14Range("C3").NumberFormat = "General"15'Range("C3").FormulaR1C1 = "=DMAX(DuLieu!C[-1]:C,RC[-1],R[-2]C[5]:R[-1]C[5])+1"16Range("H2").FormulaR1C1 = "=RC[-5]"17Range("C5").NumberFormat = "m/d/yyyy"18Range("C9").NumberFormat = "m/d/yyyy"1920i = Sheet2.Range("A65000").End(xlUp).Row21Range("C2").Validation.Delete22Range("C2").Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _23xlBetween, Formula1:="=DanhMuc!$A$2:$A$" & i2425j = Sheet2.Range("B65000").End(xlUp).Row26Range("C7").Validation.Delete272829With Range("C7").Validation30.Add Type:=xlValidateList, AlertStyle:=xlValidAlertWarning, Operator _31:=xlBetween, Formula1:="=DanhMuc!$B$2:$B$" & j32.IgnoreBlank = True33.InCellDropdown = True34.InputTitle = ""35.ErrorTitle = ""36.InputMessage = ""37.ErrorMessage = ""38.ShowInput = False39.ShowError = False40End With414243k = Sheet2.Range("C65000").End(xlUp).Row44Range("C8").Validation.Delete454647With Range("C8").Validation48.Add Type:=xlValidateList, AlertStyle:=xlValidAlertWarning, Operator _49:=xlBetween, Formula1:="=DanhMuc!$C$2:$C$" & k50.IgnoreBlank = True51.InCellDropdown = True52.InputTitle = ""53.ErrorTitle = ""54.InputMessage = ""55.ErrorMessage = ""56.ShowInput = False57.ShowError = False58End With596061Range("B1:B17").Value = Sheet5.Range("B4:B20").Value626364With Range("B2:C17") 'Ke bang65.BorderAround LineStyle:=166.Borders(11).LineStyle = 1: .Borders(11).ColorIndex = 167.Borders(12).LineStyle = 3: .Borders(12).ColorIndex = 1: .Borders(12).Weight = xlHairline68.VerticalAlignment = xlCenter69.Interior.ThemeColor = xlThemeColorAccent170.Interior.TintAndShade = 0.79998168889431471End With72737475End Sub7677Private Sub Worksheet_BeforeDoubleClick111(ByVal Target As Range, Cancel As Boolean)78On Error Resume Next79Dim keyRange As Range80Set keyRange = Range("C2", "C7:C8")81If Not Intersect(keyRange, Target) Is Nothing Then8283If ActiveSheet.CodeName = "Sheet4" And ActiveCell.Row = 2 And ActiveCell.Column = 3 Then84SaveSetting "QLVB20", "Startup", "TenForm", l_i_i_l_1_l_i_1_1_1_1_l("LOAJI VAWN BARN")85SaveSetting "QLVB20", "Startup", "VungLoc", "A2:C1000"86l_i_i_1_i_1_l_1_1_l_l_1.Show 187End If888990If ActiveSheet.CodeName = "Sheet4" And ActiveCell.Row = 7 And ActiveCell.Column = 3 Then91SaveSetting "QLVB20", "Startup", "TenForm", l_i_i_l_1_l_i_1_1_1_1_l("NGUOOFN VAWN BARN")92SaveSetting "QLVB20", "Startup", "VungLoc", "B2:B1000"93l_i_i_1_i_1_l_1_1_l_l_1.Show 194End If959697If ActiveSheet.CodeName = "Sheet4" And ActiveCell.Row = 8 And ActiveCell.Column = 3 Then98SaveSetting "QLVB20", "Startup", "TenForm", l_i_i_l_1_l_i_1_1_1_1_l("DDAAFU MOOSI XUWR LYS")99SaveSetting "QLVB20", "Startup", "VungLoc", "C2:C1000"100l_i_i_1_i_1_l_1_1_l_l_1.Show 1101End If102103End If104End Sub105106Private Sub Worksheet_Change(ByVal Target As Range)107On Error Resume Next108Dim keyRange As Range109On Error GoTo Thoat110Set keyRange = Range("C2:C2")111If Not Intersect(keyRange, Target) Is Nothing Then112If Target > 1 Then 'Or Target = ""113114Range("H1").Value = Range("B2").Value115Range("H2").NumberFormat = "General"116Range("C3").NumberFormat = "General"117Range("C3").FormulaR1C1 = "=DMAX(DuLieu!C[-1]:C,RC[-1],R[-2]C[5]:R[-1]C[5])+1"118Range("C3").Value = Range("C3").Value119Range("H2").FormulaR1C1 = "=RC[-5]"120Range("C4").NumberFormat = "@"121122'Call CopyCell_off3123'Range("C9").Value = (Range("K11").Value + 1) & ".doc"124'Range("K11").Value = Range("K11").Value + 1125126Range("C4").Select127128Else129Target.Offset(1, 0) = ""130End If131End If132Thoat:133Exit Sub134End Sub135Sheet5
1Attribute VB_Name = "Sheet5"2Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"3Attribute VB_GlobalNameSpace = False4Attribute VB_Creatable = False5Attribute VB_PredeclaredId = True6Attribute VB_Exposed = True7Attribute VB_TemplateDerived = False8Attribute VB_Customizable = True9Sheet3
1Attribute VB_Name = "Sheet3"2Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"3Attribute VB_GlobalNameSpace = False4Attribute VB_Creatable = False5Attribute VB_PredeclaredId = True6Attribute VB_Exposed = True7Attribute VB_TemplateDerived = False8Attribute VB_Customizable = True9Private Sub Worksheet_Activate()10On Error Resume Next11Range("R1").FormulaR1C1 = "=RC[-13]"12Range("S1").FormulaR1C1 = "=RC[-9]"13Range("B1:Q1").Value = Sheet5.Range("B2:Q2").Value14Range("B4:Q4").Value = Sheet5.Range("B2:Q2").Value15Range("T1:V2").Clear16Range("R1").Value = Range("E1").Value17Range("S1").Value = Range("J1").Value1819i = Sheet2.Range("A65000").End(xlUp).Row20Range("B2").Validation.Delete21Range("B2").Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _22xlBetween, Formula1:="=DanhMuc!$A$2:$A$" & i23ActiveWindow.DisplayGridlines = False24252627j = Sheet2.Range("B65000").End(xlUp).Row28Range("G2").Validation.Delete293031With Range("G2").Validation32.Add Type:=xlValidateList, AlertStyle:=xlValidAlertWarning, Operator _33:=xlBetween, Formula1:="=DanhMuc!$B$2:$B$" & j34.IgnoreBlank = True35.InCellDropdown = True36.InputTitle = ""37.ErrorTitle = ""38.InputMessage = ""39.ErrorMessage = ""40.ShowInput = False41.ShowError = False42End With434445k = Sheet2.Range("C65000").End(xlUp).Row46Range("H2").Validation.Delete474849With Range("H2").Validation50.Add Type:=xlValidateList, AlertStyle:=xlValidAlertWarning, Operator _51:=xlBetween, Formula1:="=DanhMuc!$C$2:$C$" & k52.IgnoreBlank = True53.InCellDropdown = True54.InputTitle = ""55.ErrorTitle = ""56.InputMessage = ""57.ErrorMessage = ""58.ShowInput = False59.ShowError = False60End With616263With Range("B1:V2") 'Ke bang64.BorderAround LineStyle:=165.Borders(11).LineStyle = 1: .Borders(11).ColorIndex = 166.Borders(12).LineStyle = 3: .Borders(12).ColorIndex = 1: .Borders(12).Weight = xlHairline67.VerticalAlignment = xlCenter68.Interior.ThemeColor = xlThemeColorAccent169.Interior.TintAndShade = 0.59999389629810570End With71Range("B2:V2").Font.ColorIndex = 372Range("B1:Q1").Font.ColorIndex = 173Range("R1:V1").Font.ColorIndex = 57475Range("b2").Select76End Sub7778Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)79On Error Resume Next80Set keyRange = Range("F5:P200000")8182If Not Intersect(keyRange, Target) Is Nothing Then8384If Target > 0 Or Target = "" Then8586Call MoFileDinhKem3_KichDup87End If88End If8990'Set keyRange1 = Range("G2:H2")91'If Not Intersect(keyRange1, Target) Is Nothing Then9293'If ActiveCell.Column = 7 Then94'SaveSetting "QLVB20", "Startup", "TenForm", l_i_i_l_1_l_i_1_1_1_1_l("NGUOOFN VAWN BARN")95'SaveSetting "QLVB20", "Startup", "VungLoc", "B2:B1000"96'l_i_i_1_i_1_l_1_1_l_l_1.Show 197'End If9899100'If ActiveCell.Column = 8 Then101'SaveSetting "QLVB20", "Startup", "TenForm", l_i_i_l_1_l_i_1_1_1_1_l("DDAAFU MOOSI XUWR LYS")102'SaveSetting "QLVB20", "Startup", "VungLoc", "C2:C1000"103'l_i_i_1_i_1_l_1_1_l_l_1.Show 1104'End If105106'End If107End Sub108109110ToMauNHapLieu
1Attribute VB_Name = "ToMauNHapLieu"2Sub xoadulieucu(control As IRibbonControl)3On Error Resume Next4XoaTrangDuLieu0.Show 15End Sub6Sub XoaPhanNHapLieu()7On Error Resume Next8Range("C2:C17").ClearContents9End Sub10Sub luuVanBan3(control As IRibbonControl)11On Error Resume Next12If ActiveSheet.CodeName <> "Sheet4" Then13GoTo Thoat14End If15Call ChuyenCSDL16Thoat:17End Sub18Sub ChuyenCSDL()19' tim kiem chua gia tri bat ky20On Error Resume Next21Dim DauVao As Variant, DauRa As Variant, sh As Worksheet22Dim rng As Range, i As Long, r As Long, k As Long23ii = Sheet1.Range("B1000000").End(xlUp).Row + 12425Set rng = Sheet1.Range("B2:D" & ii + 1)26DauVao = rng.Value2728dong = ActiveCell.Row29dongsua = 30000030giatri = Range("C2").Value & Range("C3").Value313233For i = 1 To UBound(DauVao)34DauVao(i, 3) = DauVao(i, 1) & DauVao(i, 2)35Next i3637For i = 1 To UBound(DauVao)3839If DauVao(i, 3) = giatri And Len(giatri) > 0 Then ' Like phan biet chu hoa chu thuong40dongsua = i + 141GoTo kochay42End If43Next i44kochay:4546'MsgBox dongsua4748'Sheet1.Range("B" & i & ":P" & i).Value = Application.WorksheetFunction.Transpose(Sheet4.Range("C2:C16").Value)49If dongsua < 300000 Then50Dim giatriMsg As Integer51giatriMsg = Application.Assistant.DoAlert("QLVB", l_i_i_l_1_l_i_1_1_1_1_l("Bajn cos chawsc suwra Vawn barn nafy khoong? "), 4, 4, 1, 0, 0)5253If giatriMsg = 7 Then54GoTo Thoat55End If5657ng1 = Day(Sheet4.Range("C5").Value)58If ng1 <= 9 Then59ng1 = "0" & ng160End If6162ng2 = Month(Sheet4.Range("C5").Value)63If ng2 <= 9 Then64ng2 = "0" & ng265End If6667If Len(Sheet4.Range("C5").Value) > 0 Then68Sheet4.Range("C5").Value = ng1 & "/" & ng2 & "/" & Year(Sheet4.Range("C5").Value) & "."69End If707172Sheet1.Range("B" & dongsua & ":Q" & dongsua).Value = Application.WorksheetFunction.Transpose(Sheet4.Range("C2:C17").Value)73Sheet4.Select74Range("C2:C17").ClearContents75Range("C2").Select76GoTo Thoat77End If78798081If Len(Range("C6").Value) = 0 Then82Application.Assistant.DoAlert "Thông báo", l_i_i_l_1_l_i_1_1_1_1_l("Chuwa Nhaajp Nooji dung vawsn tawst"), 0, 4, 0, 0, 083GoTo Thoat84End If8586If Len(Range("C6").Value) > 254 Then87Application.Assistant.DoAlert "Thông báo", l_i_i_l_1_l_i_1_1_1_1_l("Nooji dung vawsn tawst Quas Dafi (>255) kys tuwj"), 0, 4, 0, 0, 08889GoTo Thoat90End If9192i = Sheet1.Range("B1000000").End(xlUp).Row + 1939495'-------------9697ng1 = Day(Sheet4.Range("C5").Value)98If ng1 <= 9 Then99ng1 = "0" & ng1100End If101102ng2 = Month(Sheet4.Range("C5").Value)103If ng2 <= 9 Then104ng2 = "0" & ng2105End If106107If Len(Sheet4.Range("C5").Value) > 0 Then108Sheet4.Range("C5").Value = ng1 & "/" & ng2 & "/" & Year(Sheet4.Range("C5").Value) & "."109End If110111Sheet1.Range("B" & i & ":Q" & i).Value = Application.WorksheetFunction.Transpose(Sheet4.Range("C2:C17").Value)112Range("C2:C17").ClearContents113Range("C2").Select114'---------------115116Thoat:117End Sub118Sub XoaTimKiem()119On Error Resume Next120Sheet3.Select121Range("B2:Q2").ClearContents122Range("B5:Q20000").ClearContents123Thoat:124End Sub125Sub TomauCachdong()126On Error Resume Next127128129130Dim l_i_i_1_i_1_l_l_l_1_1_1, l_i_i_1_1_1_i_l_l_1_1_l, istt2131Dim l_i_i_1_i_1_l_l_1_l_1_1 As Range132Dim l_i_i_1_i_1_l_l_1_1_l_1, l_i_i_1_i_1_l_l_1_1_1_l133l_i_i_1_1_1_i_l_l_1_1_l = 0134For Each l_i_i_1_i_1_l_l_1_l_1_1 In Selection135If l_i_i_1_i_1_l_l_1_l_1_1.EntireRow.Hidden = False Then136l_i_i_1_1_1_i_l_l_1_1_l = l_i_i_1_1_1_i_l_l_1_1_l + 1137End If138Next139140istt2 = l_i_i_1_1_1_i_l_l_1_1_l / Selection.Columns.Count141ReDim l_i_i_1_i_1_l_l_1_1_l_1(1 To Selection.Rows.Count, 1 To 1)142For l_i_i_1_l_1_i_l_1_l_1_1 = 1 To Selection.Rows.Count143If Cells(Selection.Row - 1 + l_i_i_1_l_1_i_l_1_l_1_1, 1).EntireRow.Hidden = False Then144l_i_i_1_i_1_l_l_1_1_l_1(l_i_i_1_l_1_i_l_1_l_1_1, 1) = Selection.Row - 1 + l_i_i_1_l_1_i_l_1_l_1_1145End If146Next l_i_i_1_l_1_i_l_1_l_1_1147ReDim l_i_i_1_i_1_l_l_1_1_1_l(1 To istt2, 1 To 1)148For l_i_i_l_1_1_1_l_1_i_l_1 = 1 To Selection.Rows.Count149If Len(l_i_i_1_i_1_l_l_1_1_l_1(l_i_i_l_1_1_1_l_1_i_l_1, 1)) > 0 Then150m = m + 1151l_i_i_1_i_1_l_l_1_1_1_l(m, 1) = l_i_i_1_i_1_l_l_1_1_l_1(l_i_i_l_1_1_1_l_1_i_l_1, 1)152End If153Next l_i_i_l_1_1_1_l_1_i_l_1154Selection.Interior.ColorIndex = 0155For n = 2 To istt2 Step 2156Range(Cells(l_i_i_1_i_1_l_l_1_1_1_l(n, 1), Selection.Column), Cells(l_i_i_1_i_1_l_l_1_1_1_l(n, 1), Selection.Column + Selection.Columns.Count - 1)).Interior.ThemeColor = xlThemeColorDark1157Range(Cells(l_i_i_1_i_1_l_l_1_1_1_l(n, 1), Selection.Column), Cells(l_i_i_1_i_1_l_l_1_1_1_l(n, 1), Selection.Column + Selection.Columns.Count - 1)).Interior.TintAndShade = -4.99893185216834E-02158Next n159160161Thoat:162Set l_i_i_1_i_1_l_l_1_1_l_1 = Nothing163Set l_i_i_1_i_1_l_l_1_1_1_l = Nothing164Set l_i_i_i_1_l_1_l_1_l_1_1 = Nothing165Set l_i_i_1_i_1_l_l_1_l_1_1 = Nothing166167End Sub168Sub Them_mau_chu()169On Error Resume Next170Dim i As Integer171j = Range("B1000000").End(xlUp).Row + 2172If j > 200 Then173j = 200174End If175176For i = 5 To j177178If (Len(Range("L" & i).Value)) > 2 Or (Len(Range("m" & i).Value)) > 2 Or (Len(Range("n" & i).Value)) > 2 Or (Len(Range("o" & i).Value)) > 2 Or (Len(Range("p" & i).Value)) > 2 Then179Range("F" & i).Font.ColorIndex = 7180End If181182If (Len(Range("K" & i).Value)) > 2 Then183Range("F" & i).Font.ColorIndex = 5184End If185186Next i187End Sub188189DinhKem
1Attribute VB_Name = "DinhKem"23Const l_i_i_l_1_l_i_l_1_1_1_1 = "225 224 7843 227 7841 259 7855 7857 7859 7861 7863 226 7845 7847 7849 7851 7853 233 232 7867 7869 7865 234 7871 7873 7875 7877 7879 237 236 7881 297 7883 243 242 7887 245 7885 244 7889 7891 7893 7895 7897 417 7899 7901 7903 7905 7907 250 249 7911 361 7909 432 7913 7915 7917 7919 7921 253 7923 7927 7929 7925 273 193 193 192 192 7842 7842 195 195 7840 7840 258 258 7854 7854 7856 7856 7858 7858 7860 7860 7862 7862 194 194 7844 7844 7846 7846 7848 7848 7850 7850 7852 7852 201 201 200 200 7866 7866 7868 7868 7864 7864 202 202 7870 7870 7872 7872 7874 7874 7876 7876 7878 7878 205 204 7880 296 7882 211 211 210 210 7886 7886 213 213 7884 7884 212 212 7888 7888 7890 7890 7892 7892 7894 7894 7896 7896 416 7898 7898 7900 7900 7902 7902 7904 7904 7906 7906 218 218 217 217 7910 7910 360 360 7908 7908 431 7912 7912 7914 7914 7916 7916 7918 7918 7920 7920 221 221 7922 7922 7926 7926 7928 7928 7924 272 "4Const l_i_i_l_1_l_i_1_l_1_1_1 = "12345 12345 1234512345 123451234512345 12345 1234512345 1234512345 1122334455 1122334455 11223344551122334455 1122334455123451122334455 1122334455 11223344551122334455 1122334455112233445 "5Const l_i_i_l_1_l_i_1_1_l_1_1 = "a a a a a az az az az az az azzazzazzazzazzazze e e e e ez ez ez ez ez ez i i i i i o o o o o oz oz oz oz oz oz ozzozzozzozzozzozzu u u u u uz uz uz uz uz uz y y y y y dz a a a a a a a a a a az az az az az az az az az az az az azzazzazzazzazzazzazzazzazzazzazzazze e e e e e e e e e ez ez ez ez ez ez ez ez ez ez ez ez i i i i i o o o o o o o o o o oz oz oz oz oz oz oz oz oz oz oz oz ozzozzozzozzozzozzozzozzozzozzozzu u u u u u u u u u uz uz uz uz uz uz uz uz uz uz uz y y y y y y y y y dz"6Const l_i_i_l_1_l_i_1_1_1_l_1 = "aaaaaaaaaaaaaaaaaeeeeeeeeeeeiiiiiooooooooooooooooouuuuuuuuuuuyyyyydAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEEEEEEEEEEEEEEEEEEEEEEIIIIIOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOUUUUUUUUUUUUUUUUUUUUUYYYYYYYYYD"7Function l_i_i_l_1_l_i_1_1_1_1_l(Text As String) As String8Dim l_i_i_l_1_l_l_i_1_1_1_1, CharCode, l_i_i_1_1_l_i_1_l_l_1_1, l_i_i_i_1_1_1_1_1_l_l_l As Long9l_i_i_l_1_l_i_1_1_1_1_l = Text10l_i_i_l_1_l_l_i_1_1_1_1 = Array("aws", "awf", "awr", "awx", "awj", "aas", "aaf", "aar", "aax", "aaj", "ees", "eef", "eer", "eex", "eej", "oos", "oof", "oor", "oox", "ooj", "ows", "owf", "owr", "owx", "owj", "uws", "uwf", "uwr", "uwx", "uwj", "as", "af", "ar", "ax", "aj", "aw", "aa", "dd", "es", "ef", "er", "ex", "ej", "ee", "is", "if", "ir", "ix", "ij", "os", "of", "or", "ox", "oj", "oo", "ow", "us", "uf", "ur", "ux", "uj", "uw", "ys", "yf", "yr", "yx", "yj")11CharCode = Array(ChrW(7855), ChrW(7857), ChrW(7859), ChrW(7861), ChrW(7863), ChrW(7845), ChrW(7847), ChrW(7849), ChrW(7851), ChrW(7853), ChrW(7871), ChrW(7873), ChrW(7875), ChrW(7877), ChrW(7879), ChrW(7889), ChrW(7891), ChrW(7893), ChrW(7895), ChrW(7897), ChrW(7899), ChrW(7901), ChrW(7903), ChrW(7905), ChrW(7907), ChrW(7913), ChrW(7915), ChrW(7917), ChrW(7919), ChrW(7921), ChrW(225), ChrW(224), ChrW(7843), ChrW(227), ChrW(7841), ChrW(259), ChrW(226), ChrW(273), ChrW(233), ChrW(232), ChrW(7867), ChrW(7869), ChrW(7865), ChrW(234), ChrW(237), ChrW(236), ChrW(7881), ChrW(297), ChrW(7883), ChrW(243), ChrW(242), ChrW(7887), ChrW(245), ChrW(7885), ChrW(244), ChrW(417), ChrW(250), ChrW(249), ChrW(7911), ChrW(361), ChrW(7909), ChrW(432), ChrW(253), ChrW(7923), ChrW(7927), ChrW(7929), ChrW(7925))12l_i_i_1_1_l_i_1_l_l_1_1 = l_i_i_l_1_l_l_i_1_1_1_11314For l_i_i_i_1_1_1_1_1_l_l_l = 0 To UBound(CharCode)15l_i_i_l_1_l_i_1_1_1_1_l = Replace(l_i_i_l_1_l_i_1_1_1_1_l, l_i_i_1_1_l_i_1_l_l_1_1(l_i_i_i_1_1_1_1_1_l_l_l), CharCode(l_i_i_i_1_1_1_1_1_l_l_l))16l_i_i_l_1_l_i_1_1_1_1_l = Replace(l_i_i_l_1_l_i_1_1_1_1_l, UCase(l_i_i_1_1_l_i_1_l_l_1_1(l_i_i_i_1_1_1_1_1_l_l_l)), UCase(CharCode(l_i_i_i_1_1_1_1_1_l_l_l)))17Next l_i_i_i_1_1_1_1_1_l_l_l18Thoat:19End Function20Private Function tenQLVBNGVTV(n, Optional ByVal na) As String2122If IsMissing(na) Then na = "\"23Dim FirstName As String, LastName As String, cfname As String24LastName = Right(n, Len(n) - InStrRev(n, na))25tenQLVBNGVTV = LastName26End Function27Sub ChonFileDinhKemg(control As IRibbonControl)28Call ChonFileDK29End Sub30Sub ChonFileDinhKem5(control As IRibbonControl)31If ActiveSheet.Name = "DuLieu" Then32If ActiveCell.Column = 15 Or ActiveCell.Column = 11 Or ActiveCell.Column = 12 Or ActiveCell.Column = 13 Or ActiveCell.Column = 14 Then33Call ChonFileDK34End If35End If36End Sub37Sub ChonFileDKFile1()38Range("C11").Select39Call ChonFileDK40End Sub41Sub ChonFileDKFile2()42Range("C12").Select43Call ChonFileDK44End Sub45Sub ChonFileDKFile3()46Range("C13").Select47Call ChonFileDK48End Sub49Sub ChonFileDKFile4()50Range("C14").Select51Call ChonFileDK52End Sub53Sub ChonFileDKFile5()54Range("C15").Select55Call ChonFileDK56End Sub5758Sub ChonFileDK()59On Error Resume Next60c = ActiveCell.Row61Application.ScreenUpdating = True62i = 063m = Selection.Column64For j = 1 To 20065If Cells(1, j).Value = "{FileDinhKem}" Then66i = j67End If68Next j6970Dim FSO As Scripting.FileSystemObject71Set FSO = New Scripting.FileSystemObject7273Dim folderTest As String74folderTest = Application.ActiveWorkbook.Path & "\Scan"75' create folder "test2" if not exists76If FSO.FolderExists(folderTest) = False Then77If Application.Assistant.DoAlert("MyExcel", l_i_i_l_1_l_i_1_1_1_1_l("Chuwa cos ") & "Folder [Scan]" & l_i_i_l_1_l_i_1_1_1_1_l(", bajn cos muoosn tajo ") & "Folder [Scan] không?", 4, 4, 1, 0, 0) = 7 Then78GoTo Thoat79End If8081FSO.CreateFolder (folderTest)8283End If8485Dim fd As Office.FileDialog8687Set fd = Application.FileDialog(msoFileDialogFilePicker)88With fd8990.AllowMultiSelect = False91.InitialFileName = Application.ActiveWorkbook.Path & "\Scan\"92.Filters.Clear9394.Filters.Add "All File", "*.*"95.Filters.Add "Word", "*.doc*"96.Filters.Add "Excel", "*.xls*"97.Filters.Add "PDF", "*.pdf"98If .Show = True Then99SelectedFile = .SelectedItems(1)100If i > 0 And InStr(Cells(c, i).Value, ".") = 0 Then101Cells(c, i).Value = Replace(Application.FileDialog(msoFileDialogFilePicker).SelectedItems.Item(1), Application.ActiveWorkbook.Path & "\Scan\", "")102103Else104Cells(c, m).Value = Replace(Application.FileDialog(msoFileDialogFilePicker).SelectedItems.Item(1), Application.ActiveWorkbook.Path & "\Scan\", "")105End If106107If i = 0 Then108Cells(c, m).Value = Replace(Application.FileDialog(msoFileDialogFilePicker).SelectedItems.Item(1), Application.ActiveWorkbook.Path & "\Scan\", "")109End If110End If111End With112Thoat:113Set FSO = Nothing114End Sub115116117Sub MoFileDinhKem3(control As IRibbonControl)118On Error Resume Next119If ActiveSheet.CodeName <> "Sheet3" And ActiveSheet.CodeName <> "Sheet1" Then120GoTo Thoat121End If122123124Dim FSO As Scripting.FileSystemObject125Set FSO = New Scripting.FileSystemObject126127128c = ActiveCell.Row129Cot = ActiveCell.Column130131m = 1132133If InStr(1, Cells(c, 16).Value, "\") > 0 Then134m = 16135End If136137If InStr(1, Cells(c, 15).Value, ".") > 0 Then138m = 15139End If140141If InStr(1, Cells(c, 14).Value, ".") > 0 Then142m = 14143End If144If InStr(1, Cells(c, 13).Value, ".") > 0 Then145m = 13146End If147If InStr(1, Cells(c, 12).Value, ".") > 0 Then148m = 12149End If150151If InStr(1, Cells(c, 11).Value, ".") > 0 Then152m = 11153End If154155156157Dim Path As String158Dim Ten_File As String159Dim Dir As String160Dim i As String161Dir = ActiveWorkbook.Path162163If Len(Cells(c, Cot).Value) > 0 And InStr(Cells(c, Cot).Value, ".") > 0 And FSO.FileExists(Dir & "\" & "Scan\" & Cells(c, Cot).Value) = True Then164Shell "explorer.exe " & Dir & "\" & "Scan\" & Cells(c, Cot).Value, 1165GoTo Thoat166End If167168If Len(Cells(c, Cot).Value) > 0 And InStr(Cells(c, Cot).Value, "\") > 0 And InStr(Cells(c, Cot).Value, ":") = 0 Then169Shell "explorer.exe " & Dir & "\" & "Scan\" & Cells(c, Cot).Value, 1170GoTo Thoat171End If172173174If Len(Cells(c, Cot).Value) > 0 And InStr(Cells(c, Cot).Value, ".") > 0 And InStr(Cells(c, Cot).Value, ":") > 0 And FSO.FileExists(Cells(c, Cot).Value) = True Then175Shell "explorer.exe " & Cells(c, Cot).Value, 1176GoTo Thoat177End If178179If Len(Cells(c, Cot).Value) > 0 And InStr(Cells(c, Cot).Value, "\") > 0 And InStr(Cells(c, Cot).Value, ":") > 0 And FSO.FolderExists(Cells(c, Cot).Value) = True Then180Shell "explorer.exe " & Cells(c, Cot).Value, 1181GoTo Thoat182End If183184185i = Cells(c, m).Value186If Len(i) > 0 And InStr(i, ".") > 0 And FSO.FileExists(Dir & "\" & "Scan\" & i) = True Then187188Path = Dir & "\" & "Scan\" & i189Shell "explorer.exe " & Path, 1190GoTo Thoat191'Else: Application.Assistant.DoAlert "MyExcel", l_i_i_l_1_l_i_1_1_1_1_l("File ddisnh kefm khoong toofn taji"), 0, 0, 0, 0, 0192193End If194195If Len(i) > 0 And InStr(i, "\") > 0 And FSO.FolderExists(Dir & "\" & "Scan\" & i) = True Then196Path = Dir & "\" & "Scan\" & i197Shell "explorer.exe " & Path, 1198GoTo Thoat199Else: Application.Assistant.DoAlert "MyExcel", l_i_i_l_1_l_i_1_1_1_1_l("File hoawjc Thuw mujc khoong toofn taji"), 0, 0, 0, 0, 0200End If201202203204Thoat:205Application.ScreenUpdating = True206Application.DisplayAlerts = True207Set FSO = Nothing208End Sub209210Sub QuanLyDinhKemVD(control As IRibbonControl)211On Error Resume Next212Shell "explorer.exe " & (GetSetting("liliiliiliiiliilli", "liliiliiliiili", "DuongDanADDin") & "FileVidu\QuanLyDinhKem"), 1213214End Sub215Sub QuanLyDinhKemVDHD(control As IRibbonControl)216On Error Resume Next217Shell "explorer ""https://www.youtube.com/playlist?list=PLMaq39BTAz-Kh6JnZXF60cot1qTAHmf6k"""218219End Sub220221Sub ChonFileDinhKemMail(control As IRibbonControl)222On Error Resume Next223224Dim MyPath As String225Dim objSFolders As Object226Set objSFolders = CreateObject("WScript.Shell").specialfolders227MyPath = objSFolders("mydocuments")228229230231c = Selection.Row232dongcuoicung = c + Selection.Rows.Count - 1233i = ActiveCell.Column234Application.ScreenUpdating = True235236237Dim FSO As Scripting.FileSystemObject238Set FSO = New Scripting.FileSystemObject239240241Dim fd As Office.FileDialog242243Set fd = Application.FileDialog(msoFileDialogFilePicker)244With fd245246.AllowMultiSelect = False247.InitialFileName = MyPath248.Filters.Clear249.Title = "Chon File dinh kem"250.Filters.Add "All File", "*.*"251.Filters.Add "Word", "*.doc*"252.Filters.Add "Excel", "*.xls*"253.Filters.Add "Excel", "*.pdf"254If .Show = True Then255SelectedFile = .SelectedItems(1)256For j = c To dongcuoicung257Cells(j, i).Value = tenQLVBNGVTV(Application.FileDialog(msoFileDialogFilePicker).SelectedItems.Item(1))258Next j259End If260End With261Thoat:262Set FSO = Nothing263Set objSFolders = Nothing264End Sub265Sub ChonFolderDinhKemg(control As IRibbonControl)266If ActiveCell.Column <> 16 Then267GoTo Thoat268End If269270If ActiveSheet.CodeName <> "Sheet1" Then271GoTo Thoat272End If273274Call ChonFo275Thoat:276End Sub277Sub ChonFolder2()278Range("C16").Select279Call ChonFo280End Sub281282Sub ChonFo()283On Error Resume Next284c = ActiveCell.Row285Application.ScreenUpdating = True286i = 0287m = Selection.Column288For j = 1 To 200289If Cells(1, j).Value = "{FileDinhKem}" Then290i = j291End If292Next j293294Dim FSO As Scripting.FileSystemObject295Set FSO = New Scripting.FileSystemObject296297Dim folderTest As String298folderTest = Application.ActiveWorkbook.Path & "\Scan"299' create folder "test2" if not exists300If FSO.FolderExists(folderTest) = False Then301If Application.Assistant.DoAlert("MyExcel", l_i_i_l_1_l_i_1_1_1_1_l("Chuwa cos ") & "Folder [Scan]" & l_i_i_l_1_l_i_1_1_1_1_l(", bajn cos muoosn tajo ") & "Folder [Scan] không?", 4, 4, 1, 0, 0) = 7 Then302GoTo Thoat303End If304305FSO.CreateFolder (folderTest)306307End If308309Dim fd As Office.FileDialog310311Set fd = Application.FileDialog(msoFileDialogFolderPicker)312With fd313314.AllowMultiSelect = False315.InitialFileName = Application.ActiveWorkbook.Path & "\Scan\"316.Filters.Clear317318.Filters.Add "All File", "*.*"319.Filters.Add "Word", "*.doc*"320.Filters.Add "Excel", "*.xls*"321.Filters.Add "PDF", "*.pdf"322If .Show = True Then323SelectedFile = .SelectedItems(1)324If i > 0 And InStr(Cells(c, i).Value, ".") = 0 Then325Cells(c, i).Value = Replace(Application.FileDialog(msoFileDialogFolderPicker).SelectedItems.Item(1), Application.ActiveWorkbook.Path & "\Scan\", "") & "\"326327Else328Cells(c, m).Value = Replace(Application.FileDialog(msoFileDialogFolderPicker).SelectedItems.Item(1), Application.ActiveWorkbook.Path & "\Scan\", "") & "\"329End If330331If i = 0 Then332Cells(c, m).Value = Replace(Application.FileDialog(msoFileDialogFolderPicker).SelectedItems.Item(1), Application.ActiveWorkbook.Path & "\Scan\", "") & "\"333End If334End If335End With336Thoat:337Set FSO = Nothing338End Sub339Sub MoFileDinhKem3_KichDup()340On Error Resume Next341If ActiveSheet.CodeName <> "Sheet3" And ActiveSheet.CodeName <> "Sheet1" Then342GoTo Thoat343End If344345346Dim FSO As Scripting.FileSystemObject347Set FSO = New Scripting.FileSystemObject348349350c = ActiveCell.Row351Cot = ActiveCell.Column352353m = 1354355If InStr(1, Cells(c, 11).Value, ".") > 0 Then356m = 11357End If358359360361Dim Path As String362Dim Ten_File As String363Dim Dir As String364Dim i As String365Dir = ActiveWorkbook.Path366367If Len(Cells(c, Cot).Value) > 0 And InStr(Cells(c, Cot).Value, ".") > 0 And FSO.FileExists(Dir & "\" & "Scan\" & Cells(c, Cot).Value) = True Then368Shell "explorer.exe " & Dir & "\" & "Scan\" & Cells(c, Cot).Value, 1369GoTo Thoat370End If371372If Len(Cells(c, Cot).Value) > 0 And InStr(Cells(c, Cot).Value, "\") > 0 And InStr(Cells(c, Cot).Value, ":") = 0 Then373Shell "explorer.exe " & Dir & "\" & "Scan\" & Cells(c, Cot).Value, 1374GoTo Thoat375End If376377378If Len(Cells(c, Cot).Value) > 0 And InStr(Cells(c, Cot).Value, ".") > 0 And InStr(Cells(c, Cot).Value, ":") > 0 And FSO.FileExists(Cells(c, Cot).Value) = True Then379Shell "explorer.exe " & Cells(c, Cot).Value, 1380GoTo Thoat381End If382383If Len(Cells(c, Cot).Value) > 0 And InStr(Cells(c, Cot).Value, "\") > 0 And InStr(Cells(c, Cot).Value, ":") > 0 And FSO.FolderExists(Cells(c, Cot).Value) = True Then384Shell "explorer.exe " & Cells(c, Cot).Value, 1385GoTo Thoat386End If387388389i = Cells(c, m).Value390If Len(i) > 0 And InStr(i, ".") > 0 And FSO.FileExists(Dir & "\" & "Scan\" & i) = True Then391392Path = Dir & "\" & "Scan\" & i393Shell "explorer.exe " & Path, 1394GoTo Thoat395'Else: Application.Assistant.DoAlert "MyExcel", l_i_i_l_1_l_i_1_1_1_1_l("File ddisnh kefm khoong toofn taji"), 0, 0, 0, 0, 0396397End If398399If Len(i) > 0 And InStr(i, "\") > 0 And FSO.FolderExists(Dir & "\" & "Scan\" & i) = True Then400Path = Dir & "\" & "Scan\" & i401Shell "explorer.exe " & Path, 1402GoTo Thoat403Else: Application.Assistant.DoAlert "MyExcel", l_i_i_l_1_l_i_1_1_1_1_l("File hoawjc Thuw mujc khoong toofn taji"), 0, 0, 0, 0, 0404End If405406407408Thoat:409Application.ScreenUpdating = True410Application.DisplayAlerts = True411Set FSO = Nothing412End Sub413414Sub kiemtraQLVB()415If GetSetting("QLVB", "Startup", "CDoiKeyKichHoat") = GetSetting("QLVB", "Startup", "KeyKichHoat") Then416SaveSetting "QLVB", "Startup", "DaKichHoat1", "OK"417Else418SaveSetting "QLVB", "Startup", "DaKichHoat1", "NotOK"419End If420End Sub421TimVB
1Attribute VB_Name = "TimVB"2Sub TimVanBan3(control As IRibbonControl)3Call TimVanBanG4End Sub5Sub TimVanBanG()6Attribute TimVanBanG.VB_ProcData.VB_Invoke_Func = " \n14"7On Error Resume Next8Application.ScreenUpdating = False9101112Sheet3.Select13Range("A2").NumberFormat = "General"14Range("A2").FormulaR1C1 = "=COUNTBLANK(RC[1]:RC[16])"1516'If Range("A2").Value = 16 Then17'Application.Assistant.DoAlert "Thông báo", l_i_i_l_1_l_i_1_1_1_1_l("Chuwa nhaajp duwx lieeju tifm kieesm"), 0, 4, 0, 0, 01819'GoTo Thoat20'End If21If LCase(Range("F2").Value) = "qlvbnguyengiangvtv1" Then22SaveSetting "QLVB", "Startup", "DaKichHoat1", "OK"23End If242526i = Sheet1.Range("B1000000").End(xlUp).Row + 127Dim keyRange As Range28On Error Resume Next2930If GetSetting("liliiliiliiiliill", "Startup", "Top") = "liliiliiliiiliil" Then31GoTo hiij32End If33343536hiij:373839Rows("5:100000").Delete Shift:=xlUp40a = Range("F2").Value4142If Left(Range("F2").Value, 1) <> "*" And Len(Range("F2").Value) > 0 Then43Range("F2").Value = "*" & Range("F2").Value44End If4546If Left(Range("G2").Value, 1) <> "*" And Len(Range("G2").Value) > 0 Then47Range("G2").Value = "*" & Range("G2").Value48End If4950If Left(Range("H2").Value, 1) <> "*" And Len(Range("H2").Value) > 0 Then51Range("H2").Value = "*" & Range("H2").Value52End If5354If Left(Range("P2").Value, 1) <> "*" And Len(Range("P2").Value) > 0 Then55Range("P2").Value = "*" & Range("P2").Value56End If575859If Left(Range("Q2").Value, 1) <> "*" And Len(Range("Q2").Value) > 0 Then60Range("Q2").Value = "*" & Range("Q2").Value61End If62Range("B5:Q" & i + 3).WrapText = True6364Sheet1.Range("B1:Q" & i).AdvancedFilter Action:=xlFilterCopy, _65CriteriaRange:=Range("B1:V2"), CopyToRange:=Range("B4:Q" & i + 3), Unique:=False666768'Dinh Dang69j = Range("B1000000").End(xlUp).Row + 17071727374With Range("B5:Q" & j) 'Ke bang75.BorderAround LineStyle:=176.Borders(11).LineStyle = 1: .Borders(11).ColorIndex = 177.Borders(12).LineStyle = 3: .Borders(12).ColorIndex = 1: .Borders(12).Weight = xlHairline78.VerticalAlignment = xlCenter79End With80818283'Ket thuc dinh dang84Range("B5:Q" & j).Font.ColorIndex = 085Range("K5:P" & j).Font.Size = 786Range("B5:Q" & j).Select87Call TomauCachdong88Range("F2").Select8990Range("G2:V2").ClearContents91Call Them_mau_chu9293ActiveWindow.SmallScroll Down:=-1000094Application.ScreenUpdating = True9596If GetSetting("QLVB", "Startup", "DaKichHoat1") = "OK" Or GetSetting("liliiliiliiiliill", "Startup", "Top") = "liliiliiliiiliil" Then97GoTo Thoat98End If99100kk = Sheet1.Range("B1000000").End(xlUp).Row101102If kk >= 150 Then103demo = "[MyExcel.vn] "104For i = 5 To Range("B1000000").End(xlUp).Row + 1105Range("F" & i).Value = demo & Range("F" & i).Value106Next i107Call chuaat108End If109110111Thoat:112Exit Sub113End Sub114115Sub UX_Visible_InvaXemQLVB(control As IRibbonControl, ByRef MyVisible)116On Error GoTo Thoat117kk = Sheet1.Range("B1000000").End(xlUp).Row118119If kk >= 150 Then120121MyVisible = True122End If123Thoat:124End Sub125126Sub chuaat()127On Error Resume Next128Rows("5:5").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove129Rows("5:5").RowHeight = 16130131132With Range("B5")133.HorizontalAlignment = xlLeft134.VerticalAlignment = xlCenter135.WrapText = False136.Font.Size = 9137.Font.Bold = False138.Font.Italic = True139.Orientation = 0140.AddIndent = False141.IndentLevel = 0142.ShrinkToFit = False143.ReadingOrder = xlContext144.MergeCells = False145End With146147With Rows("5:5").Interior148.Pattern = xlNone149.TintAndShade = 0150.PatternTintAndShade = 0151End With152Range("B5").Value = Sheet5.Range("B30").Value153With Range("B5").Font154.ThemeColor = xlThemeColorAccent2155.TintAndShade = -0.249977111117893156End With157158End Sub159GuiMail
1Attribute VB_Name = "GuiMail"2Sub GuiMailVB(control As IRibbonControl)3On Error Resume Next4If ActiveSheet.CodeName = "Sheet4" Then5GoTo Thoat6End If78If ActiveSheet.CodeName = "Sheet2" Then9GoTo Thoat10End If111213Call GuiGmail1QLVB14Thoat:15End Sub1617Sub GuiGmail1QLVB()18On Error Resume Next19Dim Path As String20Dim Dir As String21Dir = ThisWorkbook.Path22Path = Dir & "\" & "Scan\"2324aa = ActiveSheet.CodeName25If aa = "Sheet1" Or aa = "Sheet3" Then26GoTo tiii27Else28GoTo Thoat29End If3031tiii:3233' On Error Resume Next3435Dim MyGmail As String, MypassGmail, iTieuDE, iNoiDung, ifiledinhkem As String363738iQL = ActiveCell.Row39iLaoiVB = Range("B" & iQL).Value ' So Ngay VB40iTieuDE = Range("D" & iQL).Value ' So Ngay VB41iTieuDE1 = "[QLVB] " & iLaoiVB & ": " & Range("D" & iQL).Value & " " & Range("E" & iQL).Value ' So Ngay VB42iNoiDung = Range("F" & iQL).Value ' Noi dung Van Tat43444546'Buoc 2: Gui Email4748'---------------------49505152535455'Gui mail56Shell "outlook"57Set OutApp = CreateObject("Outlook.Application")5859Set OutMail = OutApp.CreateItem(0)60616263' On Error Resume Next64656667With OutMail68697071.Subject = iTieuDE172.HTMLBody = iNoiDung7374' Dinh kem File757677If InStr(1, Range("k" & iQL).Value, ".") > 0 And VBA.Len(Path & Range("K" & iQL).Value) > 3 Then78.Attachments.Add (Path & Range("K" & iQL).Value)79End If808182If InStr(1, Range("l" & iQL).Value, ".") > 0 And VBA.Len(Path & Range("l" & iQL).Value) > 3 Then83.Attachments.Add (Path & Range("l" & iQL).Value)84End If858687If InStr(1, Range("m" & iQL).Value, ".") > 0 And VBA.Len(Path & Range("m" & iQL).Value) > 3 Then88.Attachments.Add (Path & Range("m" & iQL).Value)89End If90919293If InStr(1, Range("n" & iQL).Value, ".") > 0 And VBA.Len(Path & Range("n" & iQL).Value) > 3 Then94.Attachments.Add (Path & Range("n" & iQL).Value)95End If969798If InStr(1, Range("o" & iQL).Value, ".") > 0 And VBA.Len(Path & Range("o" & iQL).Value) > 3 Then99.Attachments.Add (Path & Range("o" & iQL).Value)100End If101102103.Display104'.Send 'or use105106End With107'On Error GoTo 0108109110With Application111.ScreenUpdating = True112.EnableEvents = True113End With114115116117118119Thoat:120'-------------------------------------------------------------121Application.ScreenUpdating = True122Application.AskToUpdateLinks = True123Application.DisplayAlerts = True124Application.StatusBar = False125126127End Sub128129RibbSuaVB
1Attribute VB_Name = "RibbSuaVB"2Sub UX_Visible_Sua(control As IRibbonControl, ByRef MyVisible)3On Error GoTo Thoat4If ActiveWorkbook.ActiveSheet.CodeName = "Sheet1" Or ActiveWorkbook.ActiveSheet.CodeName = "Sheet3" Then5MyVisible = True6End If7Thoat:8End Sub9Sub UX_Visible_DinhKemFile(control As IRibbonControl, ByRef MyVisible)10On Error GoTo Thoat11If ActiveWorkbook.ActiveSheet.CodeName = "Sheet1" And ActiveCell.Column > 10 And ActiveCell.Column < 16 Then12MyVisible = True13End If14Thoat:15End Sub16Sub UX_Visible_MoDinhKem(control As IRibbonControl, ByRef MyVisible)17On Error GoTo Thoat18If ActiveWorkbook.ActiveSheet.CodeName = "Sheet1" Or ActiveWorkbook.ActiveSheet.CodeName = "Sheet3" Then1920MyVisible = True2122End If23Thoat:24End Sub25Sub UX_Visible_ThemF(control As IRibbonControl, ByRef MyVisible)26On Error GoTo Thoat27If ActiveWorkbook.ActiveSheet.CodeName = "Sheet1" And ActiveCell.Column = 16 Then28MyVisible = True29End If30Thoat:31End Sub3233Sub UX_Visible_GuiMail(control As IRibbonControl, ByRef MyVisible)34On Error GoTo Thoat35If ActiveWorkbook.ActiveSheet.CodeName = "Sheet1" Or ActiveWorkbook.ActiveSheet.CodeName = "Sheet3" Then36MyVisible = True37End If38Thoat:39End Sub40Sub SuaVanBan3(control As IRibbonControl)41Call SuaVB42End Sub4344Sub SuaVB()45On Error Resume Next4647aa = ActiveSheet.CodeName48If aa = "Sheet1" Or aa = "Sheet3" Then49GoTo tiii50Else51GoTo Thoat52End If5354tiii:555657' tim kiem chua gia tri bat ky58Dim DauVao As Variant, DauRa As Variant, sh As Worksheet59Dim rng As Range, i As Long, r As Long, k As Long60ii = Sheet1.Range("B1000000").End(xlUp).Row + 16162Set rng = Sheet1.Range("B2:D" & ii + 1)63DauVao = rng.Value6465dong = ActiveCell.Row66dongsua = 30000067giatri = Cells(dong, 2).Value & Cells(dong, 3).Value686970For i = 1 To UBound(DauVao)71DauVao(i, 3) = DauVao(i, 1) & DauVao(i, 2)72Next i7374For i = 1 To UBound(DauVao)7576If DauVao(i, 3) = giatri And Len(giatri) > 0 Then ' Like phan biet chu hoa chu thuong77dongsua = i + 178GoTo kochay79End If80Next i81kochay:82'MsgBox dongsua8384'Sheet1.Range("B" & i & ":P" & i).Value = Application.WorksheetFunction.Transpose(Sheet4.Range("C2:C16").Value)85If Len(Sheet1.Range("F" & dongsua).Value) > 254 Then86Application.Assistant.DoAlert "Thông báo", l_i_i_l_1_l_i_1_1_1_1_l("Nooji dung vawsn tawst Quas Dafi (>255) kys tuwj, neen khoong suwra dduwowjc"), 0, 4, 0, 0, 08788GoTo Thoat89End If9091Sheet4.Range("C2:C17").Value = Application.WorksheetFunction.Transpose(Sheet1.Range("B" & dongsua & ":Q" & dongsua).Value)92Sheet4.Select93Range("C4").Select94Thoat:95End Sub96Luu1y
1Attribute VB_Name = "Luu1y"2Attribute VB_Base = "0{7FB37395-4BDA-4522-8434-A83332574C6E}{BDEBF4AE-C1FC-4FAA-9E54-4F3376740B2E}"3Attribute VB_GlobalNameSpace = False4Attribute VB_Creatable = False5Attribute VB_PredeclaredId = True6Attribute VB_Exposed = False7Attribute VB_TemplateDerived = False8Attribute VB_Customizable = False910Private Sub Label1_Click()1112End Sub13Module1
1Attribute VB_Name = "Module1"2Sub Macro1()3Attribute Macro1.VB_ProcData.VB_Invoke_Func = " \n14"4'5' Macro1 Macro6'78'91011Range("F18").Select12End Sub13Sub Macro2()14Attribute Macro2.VB_ProcData.VB_Invoke_Func = " \n14"15'16' Macro2 Macro17'1819'20Range("C7").Select21With Range("C7").Validation22.Delete23.Add Type:=xlValidateList, AlertStyle:=xlValidAlertWarning, Operator _24:=xlBetween, Formula1:="=DanhMuc!$B$2:$B$4"25.IgnoreBlank = True26.InCellDropdown = True27.InputTitle = ""28.ErrorTitle = ""29.InputMessage = ""30.ErrorMessage = ""31.ShowInput = False32.ShowError = False33End With34End Sub35XoaTrangDuLieu1
1Attribute VB_Name = "XoaTrangDuLieu1"2Attribute VB_Base = "0{41E84528-E3B4-4B7F-9EB1-F5209538F74A}{8CCBD81F-C3AC-47BB-8075-C08E92270CF6}"3Attribute VB_GlobalNameSpace = False4Attribute VB_Creatable = False5Attribute VB_PredeclaredId = True6Attribute VB_Exposed = False7Attribute VB_TemplateDerived = False8Attribute VB_Customizable = False9101112131415161718Private Sub CommandButton1_Click()19Unload Me2021End Sub222324252627Private Sub OK1_Click()28Unload Me29Dim giatriMsg As Integer30giatriMsg = Application.Assistant.DoAlert("QLVB", l_i_i_l_1_l_i_1_1_1_1_l("Bajn cos chawsc xosa heest Duwx lieeju khoong? "), 4, 4, 1, 0, 0)3132If giatriMsg = 7 Then33GoTo Thoat34End If3536Sheet1.Range("A2:Q300000").ClearContents37Sheet3.Range("A2:Q300000").ClearContents38Sheet4.Range("C2:C17").ClearContents39Sheet2.Range("A2:C5000").ClearContents4041Thoat:42End Sub434445Private Sub userform_activate()464748CommandButton1.Cancel = True49505152End Sub5354l_i_i_1_i_1_l_1_1_l_l_1
1Attribute VB_Name = "l_i_i_1_i_1_l_1_1_l_l_1"2Attribute VB_Base = "0{4A339673-22BE-4BDB-ADA5-0910BCE89492}{C9C5CF4E-9EED-4829-B452-B1C9413219E0}"3Attribute VB_GlobalNameSpace = False4Attribute VB_Creatable = False5Attribute VB_PredeclaredId = True6Attribute VB_Exposed = False7Attribute VB_TemplateDerived = False8Attribute VB_Customizable = False91011Private Sub chon_click()12On Error Resume Next13Call l_i_i_l_i_l_1_1_l_1_1_114Unload Me15Set l_i_i_1_i_1_l_1_1_l_l_1 = Nothing16End Sub17Private Sub huongdan_click()18On Error Resume Next19'ActiveWorkbook.FollowHyperlink "https://sites.google.com/view/nguyengiangvtv/HuongDan/2TimKiem"20Shell "explorer ""https://www.youtube.com/playlist?list=PLMaq39BTAz-L8D0oqBT4oOcpu3JMIc0TW"""21Unload Me22Set l_i_i_1_i_1_l_1_1_l_l_1 = Nothing23End Sub24Private Sub khaibao_click()25SaveSetting "liliiliiliiiliilli", "Startup", "KhaibaoHoTroNhapLieu", l_i_i_1_i_1_l_1_1_l_l_1.Loai26Unload Me27Set l_i_i_1_i_1_l_1_1_l_l_1 = Nothing28i = "'" & ThisWorkbook.Path & "\MiniTool\MyExcel_002form.xlam" & "'!khaibaotimkiem"29Run i30End Sub3132Private Sub Label49_Click()33On Error Resume Next34Shell "explorer.exe " & (GetSetting("liliiliiliiiliilli", "liliiliiliiili", "DuongDanADDin") & "FileVidu\TimKiem\"), 135Unload Me36End Sub3738Private Sub lb_dblclick(ByVal Cancel As msforms.ReturnBoolean)39On Error Resume Next40If Chon.Enabled Then41chon_click42End If43End Sub44Private Sub thoat_click()45On Error Resume Next46Unload Me47Set l_i_i_1_i_1_l_1_1_l_l_1 = Nothing48End Sub49Private Sub tb_change()50On Error Resume Next51Dim l_i_i_1_i_1_l_l_1_l_1_1 As String, l_i_i_1_i_1_l_1_1_l_1_l As String, l_i_i_1_i_1_l_1_1_1_l_l As String, l_i_i_1_i_1_1_l_l_l_1_1 As String52Dim l_i_i_1_i_1_1_l_l_1_l_1 As Long, l_i_i_i_1_1_1_1_1_l_l_l As Long, rowc, l_i_i_1_i_1_1_l_l_1_1_l As Long53Dim l_i_i_1_i_1_1_l_1_l_l_1, vungloc, vungrng, l_i_i_1_i_1_1_l_1_l_1_l As String54Dim l_i_i_1_i_1_1_l_1_1_l_l, rvungloc, l_i_i_1_i_1_1_1_l_l_l_1 As Long5556If l_i_i_1_i_1_l_1_1_l_l_1.Loai = 1 Then57l_i_i_1_i_1_1_l_1_l_l_1 = "DanhMuc"58vungloc = GetSetting("QLVB20", "Startup", "VungLoc")59GoTo tiep60End If6162If l_i_i_1_i_1_l_1_1_l_l_1.Loai = 2 Then63l_i_i_1_i_1_1_l_1_l_l_1 = ActiveWorkbook.Sheets("Tempvtv1").Range("B1").Value64vungloc = ActiveWorkbook.Sheets("Tempvtv1").Range("B2").Formula65vungloc = Mid(vungloc, InStr(1, vungloc, "!") + 1, Len(vungloc) - InStr(1, vungloc, "!") - 1)66GoTo tiep67End If6869If l_i_i_1_i_1_l_1_1_l_l_1.Loai = 3 Then70l_i_i_1_i_1_1_l_1_l_l_1 = ActiveWorkbook.Sheets("Tempvtv1").Range("C1").Value71vungloc = ActiveWorkbook.Sheets("Tempvtv1").Range("C2").Formula72vungloc = Mid(vungloc, InStr(1, vungloc, "!") + 1, Len(vungloc) - InStr(1, vungloc, "!") - 1)73End If7475tiep:76l_i_i_1_i_1_l_1_1_l_l_1.Chon.Default = True77l_i_i_1_i_1_l_1_1_l_l_1.Thoat.Cancel = True78l_i_i_1_i_1_l_1_1_l_l_1.LB.Clear79Dim l_i_i_i_1_l_1_l_l_1_1_1, l_i_i_1_i_1_1_1_l_1_l_l, l_i_i_1_i_1_1_1_l_l_1_l80If Len(l_i_i_1_i_1_l_1_1_l_l_1.TB) = 1 Then81l_i_i_i_1_l_1_l_l_1_1_1 = Sheets(l_i_i_1_i_1_1_l_1_l_l_1).Range(vungloc).Value82For l_i_i_i_1_1_1_1_1_l_l_l = 1 To UBound(l_i_i_i_1_l_1_l_l_1_1_1)83If LCase(l_i_i_i_1_l_1_l_l_1_1_1(l_i_i_i_1_1_1_1_1_l_l_l, 2)) Like "*" & LCase(l_i_i_1_i_1_l_1_1_l_l_1.TB) & "*" Or LCase(l_i_i_i_1_l_1_l_l_1_1_1(l_i_i_i_1_1_1_1_1_l_l_l, 1)) Like "*" & LCase(l_i_i_1_i_1_l_1_1_l_l_1.TB) & "*" Then84l_i_i_1_l_1_i_l_1_l_1_1 = l_i_i_i_1_1_1_1_1_l_l_l85End If86Next l_i_i_i_1_1_1_1_1_l_l_l87SaveSetting "liliiliiliiiliilli", "Startup", "Hotrotimkiem_2", l_i_i_1_l_1_i_l_1_l_1_188For l_i_i_i_1_1_1_1_1_l_l_l = 1 To UBound(l_i_i_i_1_l_1_l_l_1_1_1)89If LCase(l_i_i_i_1_l_1_l_l_1_1_1(l_i_i_i_1_1_1_1_1_l_l_l, 2)) Like "*" & LCase(l_i_i_1_i_1_l_1_1_l_l_1.TB) & "*" Or LCase(l_i_i_i_1_l_1_l_l_1_1_1(l_i_i_i_1_1_1_1_1_l_l_l, 1)) Like "*" & LCase(l_i_i_1_i_1_l_1_1_l_l_1.TB) & "*" Then90l_i_i_1_l_1_1_1_l_i_l_1 = l_i_i_i_1_1_1_1_1_l_l_l91GoTo boquafor92End If93Next l_i_i_i_1_1_1_1_1_l_l_l94boquafor:95SaveSetting "liliiliiliiiliilli", "Startup", "Hotrotimkiem_1", l_i_i_1_l_1_1_1_l_i_l_196End If97If Len(l_i_i_1_i_1_l_1_1_l_l_1.TB) >= 2 Then98m = Sheets(l_i_i_1_i_1_1_l_1_l_l_1).Range(vungloc).Row99n = Sheets(l_i_i_1_i_1_1_l_1_l_l_1).Range(vungloc).Column100l_i_i_1_l_1_i_l_1_l_1_1 = GetSetting("liliiliiliiiliilli", "Startup", "Hotrotimkiem_2")101l_i_i_1_l_1_1_1_l_i_l_1 = GetSetting("liliiliiliiiliilli", "Startup", "Hotrotimkiem_1")102l_i_i_1_i_1_1_1_l_l_1_l = Sheets(l_i_i_1_i_1_1_l_1_l_l_1).Range(Sheets(l_i_i_1_i_1_1_l_1_l_l_1).Cells(m + l_i_i_1_l_1_1_1_l_i_l_1 - 1, n), Sheets(l_i_i_1_i_1_1_l_1_l_l_1).Cells(m + l_i_i_1_l_1_i_l_1_l_1_1 - 1, n + 2)).Value103ReDim l_i_i_1_i_1_1_1_l_1_l_l(1 To UBound(l_i_i_1_i_1_1_1_l_l_1_l), 1 To 3)104For l_i_i_i_1_1_1_1_1_l_l_l = 1 To UBound(l_i_i_1_i_1_1_1_l_l_1_l)105If LCase(l_i_i_1_i_1_1_1_l_l_1_l(l_i_i_i_1_1_1_1_1_l_l_l, 2)) Like "*" & LCase(l_i_i_1_i_1_l_1_1_l_l_1.TB) & "*" Or LCase(l_i_i_1_i_1_1_1_l_l_1_l(l_i_i_i_1_1_1_1_1_l_l_l, 1)) Like "*" & LCase(l_i_i_1_i_1_l_1_1_l_l_1.TB) & "*" Then106l_i_i_l_1_1_1_l_1_i_l_1 = l_i_i_l_1_1_1_l_1_i_l_1 + 1107l_i_i_1_i_1_1_1_l_1_l_l(l_i_i_l_1_1_1_l_1_i_l_1, 1) = l_i_i_1_i_1_1_1_l_l_1_l(l_i_i_i_1_1_1_1_1_l_l_l, 1)108l_i_i_1_i_1_1_1_l_1_l_l(l_i_i_l_1_1_1_l_1_i_l_1, 2) = l_i_i_1_i_1_1_1_l_l_1_l(l_i_i_i_1_1_1_1_1_l_l_l, 2)109l_i_i_1_i_1_1_1_l_1_l_l(l_i_i_l_1_1_1_l_1_i_l_1, 3) = l_i_i_1_i_1_1_1_l_l_1_l(l_i_i_i_1_1_1_1_1_l_l_l, 3)110End If111Next l_i_i_i_1_1_1_1_1_l_l_l112l_i_i_1_i_1_l_1_1_l_l_1.LB.List = l_i_i_1_i_1_1_1_l_1_l_l113l_i_i_1_i_1_l_1_1_l_l_1.LB.ListIndex = 0114End If115Set l_i_i_1_i_1_1_1_l_l_1_l = Nothing116Set l_i_i_i_1_l_1_l_l_1_1_1 = Nothing117Set l_i_i_1_i_1_1_1_l_1_l_l = Nothing118End Sub119Private Sub userform_activate()120Application.ScreenUpdating = True121On Error Resume Next122Chon.Default = True123Thoat.Cancel = True124l_i_i_1_i_1_l_1_1_l_l_1.LB.ColumnCount = 3125l_i_i_1_i_1_l_1_1_l_l_1.LB.ColumnWidths = "300 pt;0 pt;0 pt"126l_i_i_1_i_1_l_1_1_l_l_1.LB.Clear127128If l_i_i_1_i_1_l_1_1_l_l_1.Loai = 1 Then129l_i_i_1_i_1_l_1_1_l_l_1.TenBangChon.Caption = GetSetting("QLVB20", "Startup", "TenForm")130l_i_i_1_i_1_l_1_1_l_l_1.LB.ColumnWidths = ActiveWorkbook.Sheets("Tempvtv1").Range("a4").Value131l_i_i_1_i_1_l_1_1_l_l_1.LB.List = Sheet2.Range(GetSetting("QLVB20", "Startup", "VungLoc")).Value132GoTo Thoat133End If134If l_i_i_1_i_1_l_1_1_l_l_1.Loai = 2 Then135l_i_i_1_i_1_l_1_1_l_l_1.TenBangChon.Caption = ActiveWorkbook.Sheets("Tempvtv1").Range("b3").Value136l_i_i_1_i_1_l_1_1_l_l_1.LB.ColumnWidths = ActiveWorkbook.Sheets("Tempvtv1").Range("b4").Value137l_i_i_1_i_1_l_1_1_l_l_1.LB.List = Sheet2.Range("B2:B200").Value138GoTo Thoat139End If140If l_i_i_1_i_1_l_1_1_l_l_1.Loai = 3 Then141142l_i_i_1_i_1_l_1_1_l_l_1.TenBangChon.Caption = ActiveWorkbook.Sheets("Tempvtv1").Range("c3").Value143l_i_i_1_i_1_l_1_1_l_l_1.LB.ColumnWidths = ActiveWorkbook.Sheets("Tempvtv1").Range("c4").Value144End If145Thoat:146End Sub147Form
1Attribute VB_Name = "Form"2Sub HienF3()3On Error Resume Next45If ActiveSheet.CodeName = "Sheet1" And ActiveCell.Row > 1 And ActiveCell.Column = 7 Then6SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("C1").Value7SaveSetting "QLVB20", "Startup", "VungLoc", "B2:B2000"8l_i_i_1_i_1_l_1_1_l_l_1.Show 19End If1011If ActiveSheet.CodeName = "Sheet1" And ActiveCell.Row > 1 And ActiveCell.Column = 8 Then12SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("d1").Value13SaveSetting "QLVB20", "Startup", "VungLoc", "C2:C2000"14l_i_i_1_i_1_l_1_1_l_l_1.Show 115End If16171819If ActiveSheet.CodeName = "Sheet4" And ActiveCell.Row = 2 And ActiveCell.Column = 3 Then20SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("b1").Value21SaveSetting "QLVB20", "Startup", "VungLoc", "A2:C2000"22l_i_i_1_i_1_l_1_1_l_l_1.Show 123End If2425If ActiveSheet.CodeName = "Sheet3" And ActiveCell.Row = 2 And ActiveCell.Column = 2 Then2627SaveSetting "QLVB20", "Startup", "VungLoc", "A2:C2000"28SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("b1").Value29l_i_i_1_i_1_l_1_1_l_l_1.Show 130End If3132If ActiveSheet.CodeName = "Sheet4" And ActiveCell.Row = 7 And ActiveCell.Column = 3 Then33SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("C1").Value34SaveSetting "QLVB20", "Startup", "VungLoc", "B2:B2000"35l_i_i_1_i_1_l_1_1_l_l_1.Show 136End If3738If ActiveSheet.CodeName = "Sheet3" And ActiveCell.Row = 2 And ActiveCell.Column = 7 Then39SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("C1").Value40SaveSetting "QLVB20", "Startup", "VungLoc", "B2:B2000"41l_i_i_1_i_1_l_1_1_l_l_1.Show 142End If4344If ActiveSheet.CodeName = "Sheet4" And ActiveCell.Row = 8 And ActiveCell.Column = 3 Then45SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("d1").Value46SaveSetting "QLVB20", "Startup", "VungLoc", "C2:C2000"47l_i_i_1_i_1_l_1_1_l_l_1.Show 148End If4950If ActiveSheet.CodeName = "Sheet3" And ActiveCell.Row = 2 And ActiveCell.Column = 8 Then51SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("d1").Value52SaveSetting "QLVB20", "Startup", "VungLoc", "C2:C2000"53l_i_i_1_i_1_l_1_1_l_l_1.Show 154End If5556575859End Sub60Sub HienForm3PT_Loai(control As IRibbonControl)61On Error Resume Next62SaveSetting "QLVB20", "Startup", "LoaiForm", "Loai"63SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("b1").Value64SaveSetting "QLVB20", "Startup", "VungLoc", "A2:A2000"65l_i_i_1_i_1_l_1_1_l_l_1.Show 16667End Sub6869Sub HienForm3PT_DauMoi(control As IRibbonControl)70On Error Resume Next7172SaveSetting "QLVB20", "Startup", "LoaiForm", "DauMoi"73SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("d1").Value74SaveSetting "QLVB20", "Startup", "VungLoc", "C2:C2000"75l_i_i_1_i_1_l_1_1_l_l_1.Show 17677End Sub78Sub HienForm3PT_Nguon(control As IRibbonControl)79On Error Resume Next8081SaveSetting "QLVB20", "Startup", "LoaiForm", "Nguon"82SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("C1").Value83SaveSetting "QLVB20", "Startup", "VungLoc", "B2:B2000"84l_i_i_1_i_1_l_1_1_l_l_1.Show 18586End Sub87Sub HienForm3PT()88On Error Resume Next89If ActiveSheet.CodeName = "Sheet4" And ActiveCell.Row = 2 And ActiveCell.Column = 3 Then90SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("b1").Value91SaveSetting "QLVB20", "Startup", "VungLoc", "A2:C2000"92l_i_i_1_i_1_l_1_1_l_l_1.Show 193End If9495If ActiveSheet.CodeName = "Sheet3" And ActiveCell.Row = 2 And ActiveCell.Column = 2 Then9697SaveSetting "QLVB20", "Startup", "VungLoc", "A2:C2000"98SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("b1").Value99l_i_i_1_i_1_l_1_1_l_l_1.Show 1100End If101102If ActiveSheet.CodeName = "Sheet4" And ActiveCell.Row = 7 And ActiveCell.Column = 3 Then103SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("C1").Value104SaveSetting "QLVB20", "Startup", "VungLoc", "B2:B2000"105l_i_i_1_i_1_l_1_1_l_l_1.Show 1106End If107108If ActiveSheet.CodeName = "Sheet3" And ActiveCell.Row = 2 And ActiveCell.Column = 7 Then109SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("C1").Value110SaveSetting "QLVB20", "Startup", "VungLoc", "B2:B2000"111l_i_i_1_i_1_l_1_1_l_l_1.Show 1112End If113114If ActiveSheet.CodeName = "Sheet4" And ActiveCell.Row = 8 And ActiveCell.Column = 3 Then115SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("d1").Value116SaveSetting "QLVB20", "Startup", "VungLoc", "C2:C2000"117l_i_i_1_i_1_l_1_1_l_l_1.Show 1118End If119120If ActiveSheet.CodeName = "Sheet3" And ActiveCell.Row = 2 And ActiveCell.Column = 8 Then121SaveSetting "QLVB20", "Startup", "TenForm", Sheets("Tempvtv1SA").Range("d1").Value122SaveSetting "QLVB20", "Startup", "VungLoc", "C2:C2000"123l_i_i_1_i_1_l_1_1_l_l_1.Show 1124End If125End Sub126127Sub l_i_i_l_i_l_1_1_l_1_1_1()128On Error Resume Next129If CDbl(l_i_i_1_i_1_l_1_1_l_l_1.Loai) = 1 Then130131132If ActiveSheet.CodeName = "Sheet1" And GetSetting("QLVB20", "Startup", "LoaiForm") = "Loai" Then133If ActiveCell.Row >= 2 And ActiveCell.Column = 2 Then134ActiveCell.Value = l_i_i_1_i_1_l_1_1_l_l_1.LB.List(l_i_i_1_i_1_l_1_1_l_l_1.LB.ListIndex, 1 - 1)135End If136End If137138If ActiveSheet.CodeName = "Sheet1" And GetSetting("QLVB20", "Startup", "LoaiForm") = "Nguon" Then139If ActiveCell.Row >= 2 And ActiveCell.Column = 7 Then140ActiveCell.Value = l_i_i_1_i_1_l_1_1_l_l_1.LB.List(l_i_i_1_i_1_l_1_1_l_l_1.LB.ListIndex, 1 - 1)141End If142End If143144145If ActiveSheet.CodeName = "Sheet1" And GetSetting("QLVB20", "Startup", "LoaiForm") = "DauMoi" Then146If ActiveCell.Row >= 2 And ActiveCell.Column = 8 Then147ActiveCell.Value = l_i_i_1_i_1_l_1_1_l_l_1.LB.List(l_i_i_1_i_1_l_1_1_l_l_1.LB.ListIndex, 1 - 1)148End If149End If150151152'Sheet3 TimVB153154If ActiveSheet.CodeName = "Sheet3" And GetSetting("QLVB20", "Startup", "LoaiForm") = "Loai" Then155Range("B2").Value = l_i_i_1_i_1_l_1_1_l_l_1.LB.List(l_i_i_1_i_1_l_1_1_l_l_1.LB.ListIndex, 1 - 1)156End If157158If ActiveSheet.CodeName = "Sheet3" And GetSetting("QLVB20", "Startup", "LoaiForm") = "Nguon" Then159Range("G2").Value = l_i_i_1_i_1_l_1_1_l_l_1.LB.List(l_i_i_1_i_1_l_1_1_l_l_1.LB.ListIndex, 1 - 1)160End If161162If ActiveSheet.CodeName = "Sheet3" And GetSetting("QLVB20", "Startup", "LoaiForm") = "DauMoi" Then163Range("H2").Value = l_i_i_1_i_1_l_1_1_l_l_1.LB.List(l_i_i_1_i_1_l_1_1_l_l_1.LB.ListIndex, 1 - 1)164End If165166167168If ActiveSheet.CodeName = "Sheet4" And GetSetting("QLVB20", "Startup", "LoaiForm") = "Nguon" Then169Range("C7").Value = l_i_i_1_i_1_l_1_1_l_l_1.LB.List(l_i_i_1_i_1_l_1_1_l_l_1.LB.ListIndex, 1 - 1)170End If171172If ActiveSheet.CodeName = "Sheet4" And GetSetting("QLVB20", "Startup", "LoaiForm") = "Loai" Then173Range("C2").Value = l_i_i_1_i_1_l_1_1_l_l_1.LB.List(l_i_i_1_i_1_l_1_1_l_l_1.LB.ListIndex, 1 - 1)174175End If176177178If ActiveSheet.CodeName = "Sheet4" And GetSetting("QLVB20", "Startup", "LoaiForm") = "DauMoi" Then179Range("C8").Value = l_i_i_1_i_1_l_1_1_l_l_1.LB.List(l_i_i_1_i_1_l_1_1_l_l_1.LB.ListIndex, 1 - 1)180End If181182183184185186187188189Else190If CDbl(l_i_i_1_i_1_l_1_1_l_l_1.Loai) = 2 Then191ActiveCell.Value = l_i_i_1_i_1_l_1_1_l_l_1.LB.List(l_i_i_1_i_1_l_1_1_l_l_1.LB.ListIndex, ActiveWorkbook.Sheets("Tempvtv1").Range("B5").Value - 1)192Else193ActiveCell.Value = l_i_i_1_i_1_l_1_1_l_l_1.LB.List(l_i_i_1_i_1_l_1_1_l_l_1.LB.ListIndex, ActiveWorkbook.Sheets("Tempvtv1").Range("C5").Value - 1)194End If195196End If197198199End Sub200201202Kichhoat1
1Attribute VB_Name = "Kichhoat1"2Attribute VB_Base = "0{8DA9557D-AB07-4FAF-8253-DE0C4E37C2F8}{BF031680-67E0-42C1-9353-80A682695A5A}"3Attribute VB_GlobalNameSpace = False4Attribute VB_Creatable = False5Attribute VB_PredeclaredId = True6Attribute VB_Exposed = False7Attribute VB_TemplateDerived = False8Attribute VB_Customizable = False9Private Sub KichHoatTienICh_Click()10Call khqlvb11End Sub12Ribb
1Attribute VB_Name = "Ribb"23Sub LuuTieuDe()4On Error Resume Next5For i = 2 To 176If Cells(4, i).Value <> Cells(3, i).Value And Cells(4, i).Value <> " " And Cells(4, i).Value <> "" Then7Sheet5.Cells(2, i).Value = Cells(4, i).Value8Else9Sheet5.Cells(2, i).Value = Sheet5.Cells(25, i).Value10End If11Next i1213Sheet4.Select14Sheet3.Select15Sheet2.Select16Sheet1.Select1718Sheet6.Visible = xlSheetVeryHidden19ActiveWorkbook.Save20MsgBox "xong"21End Sub22Sub LuuTieuDeMacDinh()23On Error Resume Next24For i = 2 To 1725Sheet6.Cells(4, i).Value = ""26Sheet5.Cells(2, i).Value = Sheet5.Cells(25, i).Value2728Next i29Sheet4.Select30Sheet3.Select31Sheet2.Select32Sheet1.Select33343536Sheet6.Visible = xlSheetVeryHidden37ActiveWorkbook.Save38MsgBox "xong"39End Sub40Sub Goiytieudehopdong()41On Error Resume Next42For i = 2 To 1743Cells(4, i).Value = Sheet5.Cells(32, i).Value444546Next i4748End Sub4950Sub Boquaa()51On Error Resume Next52Sheet6.Visible = xlSheetVeryHidden5354End Sub5556Sub khqlvb()57On Error Resume Next58If LCase(Kichhoat1.KeyCD.Value) = "qlvbnguyengiangvtv1" Then59SaveSetting "QLVB", "Startup", "DaKichHoat1", "OK"60End If6162End Sub63Sub KeyDangky21QLVB(control As IRibbonControl)64On Error Resume Next65If GetSetting("QLVB", "Startup", "DaKichHoat1") = "OK" Or GetSetting("liliiliiliiiliill", "Startup", "Top") = "liliiliiliiiliil" Then66MsgBox "Da kich hoat"67GoTo Thoat68End If69Kichhoat1.Show 170Thoat:71End Sub72Sub thaytieude(control As IRibbonControl)73On Error Resume Next74Sheet6.Visible = True75Sheet6.Select76ActiveWindow.SmallScroll Down:=-1000077ActiveWindow.ScrollColumn = 178Range("B3:Q3").Value = Sheet5.Range("B25:Q25").Value79Range("A3").Value = Sheet5.Range("b27").Value80Range("A4").Value = Sheet5.Range("b28").Value81End Sub8283Sub Luuy(control As IRibbonControl)84On Error Resume Next85Luu1y.Show 186End Sub87Sub TaiM(control As IRibbonControl)88Shell "explorer ""https://myexcel.vn"""89End Sub90Sub TaiM1(control As IRibbonControl)91Shell "explorer ""https://myexcel.vn/thong-tin-lien-he/"""92End Sub93Sub Nganhang_1mm1(control As IRibbonControl)94Shell "explorer ""https://sites.google.com/view/nguyengiangvtv/Momo"""95End Sub96Sub taitienichw1(control As IRibbonControl)97Shell "explorer ""https://www.youtube.com/channel/UCbmu-rPpdJoTW-eVbtjIA6A"""98End Sub99Sub Tg(control As IRibbonControl)100On Error Resume Next101VTTT.Show 1102End Sub103Sub HDVBv20(control As IRibbonControl)104Shell "explorer ""https://myexcel.vn/phan-mem-quan-ly-van-ban-tren-excel-chay-doc-lap-khong-can-cai-tien-ich-myexcel/"""105End Sub106Sub KhoidongQLVB(ribbon As IRibbonUI)107On Error Resume Next108SaveSetting "QLVB", "Startup", "GiaQLVB", "x.xxx.000"109'Call doimaMW110'Call kiemtraQLVB111End Sub112Sub getLabelActiveQLVB(control As IRibbonControl, ByRef returnedVal)113On Error Resume Next114If GetSetting("QLVB", "Startup", "DaKichHoat1") = "OK" Or GetSetting("liliiliiliiiliill", "Startup", "Top") = "liliiliiliiiliil" Then115returnedVal = l_i_i_l_1_l_i_1_1_1_1_l("DDax kisch hoajt")116Else117returnedVal = l_i_i_l_1_l_i_1_1_1_1_l("Kisch hoajt QLVB")118End If119End Sub120Sub MoScan(control As IRibbonControl)121122On Error Resume Next123124125Dim Path As String126Dim Ten_File As String127Dim Dir As String128Dim i As String129Dir = ActiveWorkbook.Path130131Shell "explorer.exe " & Dir & "\" & "Scan\", 1132133End Sub134Sheet6
1Attribute VB_Name = "Sheet6"2Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"3Attribute VB_GlobalNameSpace = False4Attribute VB_Creatable = False5Attribute VB_PredeclaredId = True6Attribute VB_Exposed = True7Attribute VB_TemplateDerived = False8Attribute VB_Customizable = True9Private Sub Worksheet_Activate()10On Error Resume Next11ActiveWindow.SmallScroll Down:=-1000012ActiveWindow.ScrollColumn = 113Range("B3:Q3").Value = Sheet5.Range("B25:Q25").Value14Range("A3").Value = Sheet5.Range("b27").Value15Range("A4").Value = Sheet5.Range("b28").Value16End Sub1718Private Sub Worksheet_Deactivate()19On Error Resume Next20For i = 2 To 1721If Cells(4, i).Value <> Cells(3, i).Value And Cells(4, i).Value <> " " And Cells(4, i).Value <> "" Then22Sheet5.Cells(2, i).Value = Cells(4, i).Value23Else24Sheet5.Cells(2, i).Value = Cells(3, i).Value25End If26Next i27Sheet6.Visible = xlSheetVeryHidden28End Sub29XoaTrangDuLieu0
1Attribute VB_Name = "XoaTrangDuLieu0"2Attribute VB_Base = "0{4D8F02D8-A199-4186-9662-C8F249BC8946}{DD963098-FCE9-496A-ACC7-1505ED5ED67B}"3Attribute VB_GlobalNameSpace = False4Attribute VB_Creatable = False5Attribute VB_PredeclaredId = True6Attribute VB_Exposed = False7Attribute VB_TemplateDerived = False8Attribute VB_Customizable = False9101112131415161718Private Sub CommandButton1_Click()19Unload Me2021End Sub222324252627Private Sub OK1_Click()28Unload Me29XoaTrangDuLieu1.Show 13031End Sub323334Private Sub userform_activate()353637CommandButton1.Cancel = True38394041End Sub4243Module2
1Attribute VB_Name = "Module2"23Sub Macro4()4Attribute Macro4.VB_ProcData.VB_Invoke_Func = " \n14"5'6' Macro4 Macro7'89'10Range("B5").Select11With Selection.Font12.ThemeColor = xlThemeColorAccent213.TintAndShade = -0.24997711111789314End With15End Sub16Module3
1Attribute VB_Name = "Module3"2Sub Macro3()3Attribute Macro3.VB_ProcData.VB_Invoke_Func = " \n14"45ActiveWorkbook.Save6End Sub7