I have data in column A of a spreadsheet. I'd like to create an array that contains all of that data, so that I can loop through it in VBA.
If the contents of A1, A2 and A3 are "example1"," example2", and "example3", in the end, I would like word_list to be something like:
word_list=array("example1","example2", "example3")
Here is what I have been working with, but it doesn't seem to be returning what I had anticipated it would
Dim DataList As Range, word_list As Variant
Set DataList = Sheets("Sheet2").Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
word_list = DataList.Value
If the contents of A1, A2 and A3 are "example1"," example2", and "example3", in the end, I would like word_list to be something like:
word_list=array("example1","example2", "example3")
Here is what I have been working with, but it doesn't seem to be returning what I had anticipated it would
Dim DataList As Range, word_list As Variant
Set DataList = Sheets("Sheet2").Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
word_list = DataList.Value