Hi Team,
I have below data in columns ("A:C:F"), I want to take all the values in a single Array,
Ar1. Could you plz assist how to achieve this task.
My attempted code
Sub test_Array()
Dim ar1 As Variant
Dim ar2 As Variant
Dim ar3 As Variant
ar1 = Sheet1.Range("A2:a5").Value
ar2 = Sheet1.Range("c2:c6").Value
ar3 = Sheet1.Range("f2:f3").Value
MsgBox WorksheetFunction.CountA(ar1)
End Sub
I have below data in columns ("A:C:F"), I want to take all the values in a single Array,
Ar1. Could you plz assist how to achieve this task.
Data1 | Data2 | Data3 | ||
Ricky | Sachin | Jaysurya | ||
Gilchrist | Virat | Kaluvitharna | ||
Mcgraw | Kohli | Mendis | ||
Shane Warne | Bumrah | |||
Dhoni |
Sub test_Array()
Dim ar1 As Variant
Dim ar2 As Variant
Dim ar3 As Variant
ar1 = Sheet1.Range("A2:a5").Value
ar2 = Sheet1.Range("c2:c6").Value
ar3 = Sheet1.Range("f2:f3").Value
MsgBox WorksheetFunction.CountA(ar1)
End Sub
Last edited: