Sub msit80_kiemtra()
Dim r As Long, arr, dArr
arr = Array("brcd", "custseq", "custnm", "apprseq", "apprdt", "apprmatdt", _
"ccy", "appramt", "dsbsseq", "dsbsdt", "dsbsmatdt", "sprd", "sprdpst", "dsbsamt", _
"dsbsccy", "rpmtamt", "intamt", "dsbsbal", "dsbsamt2", "rpmtamt2", "intamt2", "subunit", _
"custstscd", "custtpcd", "custtpnm", "custdtltpcd", "custdtltpnm", "ecomist", "ecomistnm", _
"taxtpcdloc", "taxtpcdlocnm", "ofcno", "ofcnm", "pstintamt", "pstintamt2", "buscd", "lntpcd", _
"lnsbtpcd", "lstrpmtdt", "lstintchrgprd", "nxtrpmtschddt", "nxtintschddt", "exmtintamt", "exmtintamt2", _
"finainsttpcd", "finainsttpcdnm", "sicdloc", "province", "provincenm", "district", "districtnm", "zipcd", _
"addr1", "secured", "fndrstpcd", "fndrsnm", "exemptint", "exemptinttype", "fndprpstpcd", "fndprpstpcd_code", _
"intrpmtamt", "AQCCDFIN", "intrpmtamt2", "commcd", "commmn", "grpno", "trctcd", "trctnm", "BSNSSCLTPCD", "usrid", _
"usrnm", "acramt", "lceqa", "yrdays", "intcmth", "intrpymth", "inttrmmth", "remark", "chitiet_htls")
Dim tenWsVBA, tenWs As String
tenWsVBA = ActiveSheet.CodeName
tenWs = ActiveSheet.Name
dArr = Worksheets(tenWsVBA).Range("A1:CA1").value
For r = 1 To UBound(dArr, 2) Step 1
If dArr(1, r) <> arr(r - 1) Then Exit For
Next
If r <= UBound(dArr, 2) Then MsgBox "error at cell " & Cells(1, r).Address Else MsgBox "Good"
End Sub
Khi chạy đến hôm nay lại bị phát sinh lỗi sau: [TABLE="width: 100%"]
[TR]
[TD="align: left"][/TD]
[/TR]
[TR]
[TD="align: left"]Subscript out of range (Error 9) và em vào debug thì ko biết chỉnh ntn ah? Mong mọi người chỉ giúp?[/TD]
[/TR]
[/TABLE]