I have column structure similar to the below one
Author Book
---- ----
---- ----
Vicky Book1
Vicky Book2
Giri Book1
Giri Book3
The author column is in column B and Book column might come in any column based on other column datas
I want to select values in these two columns
I tried
fileArray = Range("B4:B" & finalRow & "," & endColumn).Value
Here the first part is working fine, finalRow contains the row number till which record is there, and endColumn is where the book details will be available
If i use
fileArray = Range("B4:B" & finalRow )
it is getting values, but when i try to add one more column it is throwing error
Also i tried the below one too
fileArray = Range("B4:B9,S4:S9").Value
But it is not getting values of S4:S9
How can get the desired values?
fileArray = Range("B4:" & endColumn & finalRow). (Assuming that endColumn is a letter, not a number.)