![Office 365 Excel - 将单元格矩阵转换为没有空白的列表](https://linux22.com/image/1603763/Office%20365%20Excel%20-%20%E5%B0%86%E5%8D%95%E5%85%83%E6%A0%BC%E7%9F%A9%E9%98%B5%E8%BD%AC%E6%8D%A2%E4%B8%BA%E6%B2%A1%E6%9C%89%E7%A9%BA%E7%99%BD%E7%9A%84%E5%88%97%E8%A1%A8.png)
我正在尝试取一个 2500x2500 个单元格的矩阵(95% 的单元格是空白)并创建一个没有任何空白的列表。
答案1
首先输入您的数据A1通过CRD2500.然后运行这个简短的宏:
Sub MakeAList()
Dim r As Range, N As Long, cell As Range
Set r = Range("A1:CRD2500")
N = 1
For Each cell In r
If cell.Value <> "" Then
Range("CRE" & N).Value = cell.Value
N = N + 1
End If
Next cell
End Sub
列表将显示在列中卓越房地产经纪。