|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
学习一下,来一段数组的
arr = Range("a2:d" & Cells(Rows.Count, "d").End(xlUp).Row)
ReDim brr(1 To UBound(arr), 1 To UBound(arr, 2))
For i = 1 To UBound(arr)
If arr(i, 1) <> "" Then
m = m + 1
For j = 1 To UBound(arr, 2)
brr(m, j) = arr(i, j)
Next
For k = i + 1 To UBound(arr)
If arr(k, 1) <> "" Then
If arr(i, 1) = arr(k, 1) Then
arr(k, 1) = vbNullString
End If
End If
Next
End If
Next
[g1].CurrentRegion.Offset(1).ClearContents
[g2].Resize(UBound(brr), UBound(brr, 2)) = brr
等数组学得差不多了,再来学字典 |
|