Return cell value in a range as an array : Range Value « Excel « VBA / Excel / Access / Word






Return cell value in a range as an array

 

Sub Array3()
  Dim Data As Variant

  Data = Range("A1:A20").Value
  MsgBox "Number of Non Blank Elements = " & WorksheetFunction.CountA(Data) & vbCr
End Sub

 








Related examples in the same category

1.Reset value in a range to zero
2.Sum the range
3.Change cell A1 and move to cell A2 and change it
4.Clear NonDate Cells
5.Transferring one-dimensional arrays with build-in function