遍历列,
早上好,
我试图找到一种方式来存储值的数组:通过一列
回路(B柱)
取值,商店他们在一个数组
遍历数组,并做一些文字处理
但是,我不能想办法来循环THROU gh列并将这些值存储在一个数组中。我已经通过堆栈溢出和谷歌,但还没有找到一个成功的解决方案(还)。
提前,谢谢你的帮助。
Sub collectNums()
Dim eNumStorage() As String ' initial storage array to take values
Dim i as Integer
Dim j as Integer
Dim lrow As Integer
lrow = Cells(Rows.Count, "B").End(xlUp).Row ' The amount of stuff in the column
For i = lrow To 2 Step -1
If (Not IsEmpty(Cells(i, 2).Value)) Then ' checks to make sure the value isn't empty
i = eNumStorage ' I know this isn't right
Next i
If (IsEmpty(eNumStorage)) Then
MsgBox ("You did not enter an employee number for which to query our database. Quitting")
Exit Sub
End If
End Sub