Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50079

[SOLVED] New to arrays-Create two column array with different column order to sheet?

$
0
0
UPDATE: Yes, I know the obvious solution is to alter the worksheet column order instead. But I can't (long story) hence this thread.

I am new to arrays and wish to achieve the following:

I have worksheet range in Column A & Column B that I want to read into an array of 2 columns wide, X (variable) rows deep. Now for the catch. I need the array to have Column B data in the first array column and Column A data in the second array column.

How do I do this? (short of slowly building the array individual record by individual record)
  • Would it be possible to copy A & B columns and then transpose the column order in the array? (Don't laugh. I am new to arrays).
  • Would it be possible to somehow read Column B values and then Column A values when creating the array?
  • Messier. Would it be easier to build two arrays (one column each) and then 'join' these together in the order I want??

Viewing all articles
Browse latest Browse all 50079

Trending Articles