emgaingayngo
Thành viên hoạt động
- Tham gia
- 9/2/07
- Bài viết
- 141
- Được thích
- 5
PHP:
Sub Chap2Cua81()
Dim j1 As Long, j2 As Long, j3 As Long, GPE12 As String, k As Long
Dim mangKq(3239) As String
Dim TG As Double
GPE12 = Range("C1").Value
TG = Timer
For j1 = 1 To 81
For j2 = j1 + 1 To 81
mangKq(k) = Mid(GPE12, j1, 1) & Mid(GPE12, j2, 1)
k = k + 1
Next j2, j1
Range("A1:A3240").Value = Application.WorksheetFunction.Transpose(mangKq)
MsgBox Timer - TG
End Sub
PHP:
Sub Chap3Cua81()
Dim j1 As Long, j2 As Long, j3 As Long, GPE12 As String, k As Long
Dim mangKq(85319) As String
Dim TG As Double
GPE12 = Range("C1").Value
TG = Timer
For j1 = 1 To 81
For j2 = j1 + 1 To 81
For j3 = j2 + 1 To 81
mangKq(k) = Mid(GPE12, j1, 1) & Mid(GPE12, j2, 1) & Mid(GPE12, j3, 1)
k = k + 1
Next j3, j2, j1
Range("A1:A85320").Value = Application.WorksheetFunction.Transpose(mangKq)
MsgBox Timer - TG
End Sub
Đoạn mã trên chạy thì OK, đoạn dưới chạy thì bị báo lỗi type mismatch.
Xin chỉ giúp tôi cách khắc phục.