|
Sub test()
Dim arr1, arr2, arr3
Dim brr(1 To 3)
Dim x, y, k As Integer
k = Sheet1.Range("a65536").End(xlUp).Row
arr1 = Sheet2.Range("c2:k" & k)
arr2 = Sheet3.Range("c2:k" & k)
arr3 = Sheet4.Range("c2:k" & k)
arr = Sheet1.Range("c2:k" & k)
For x = 1 To UBound(arr, 1)
For y = 1 To UBound(arr, 2)
If arr1(x, y) = "" Then
brr(1) = 80
Else
brr(1) = Asc(arr1(x, y))
End If
If arr2(x, y) = "" Then
brr(2) = 80
Else
brr(2) = Asc(arr2(x, y))
End If
If arr3(x, y) = "" Then
brr(3) = 80
Else
brr(3) = Asc(arr3(x, y))
End If
arr(x, y) = Chr(Application.Min(brr))
Erase brr
Next y
Next x
Sheet1.Range("c2").Resize(k - 1, 9) = arr
End Sub
|
|