AlexanderBB
Well-known Member
- Joined
- Jul 1, 2009
- Messages
- 2,148
- Office Version
- 2019
- 2010
- Platform
- Windows
This was recommended as a way to build an array from Values in a Worksheet row, In this example Col Y to AF in row chRow
If works great but I've struck a problem. If only Col Y contains a value Ary is a string.
My code fails as it expects an array.
What is a good way to resolve this ? I can test isArray(ary) and perhaps force the string into an array but it doesn't seem right.
VBA Code:
Dim Ary as variant
Ary = Application.Transpose(Application.Transpose _
(Worksheets(.Name).Range("Y" & chRow & ":AF" & chRow).Value))
My code fails as it expects an array.
What is a good way to resolve this ? I can test isArray(ary) and perhaps force the string into an array but it doesn't seem right.