Hi All,
In Excel, I named three empty data ranges, with the following number of columns and rows:
Temp_One : 20 rows, 15 columns
Temp_Two : 30 rows, 15 columns
Temp_Three : 50 rows, 15 columns
I then loaded these named ranges into a VBA macro:
Temp1 = Range("Temp_One").Value
Temp2 = Range("Temp_Two").Value
Temp3 = Range("Temp_Three").Value
In the macro, I did some calculations to add 15 rows of data to Temp1 and 25 rows of data to Temp2. (In the future, the number of non-empty rows will vary.)
Now, I want to stack Temp1 and Temp2, assign this to Temp3 (which would then have 40 non-empty values), and then sort Temp3 by the first column (a year variable).
I am not sure, however, how to stack and then sort the data. In something like SAS I could do the following:
data temp3;
set temp1 temp2;
run;
proc sort data=temp3;
by year;
run;
Thanks in advance for any advice.
Best regards,
Don
In Excel, I named three empty data ranges, with the following number of columns and rows:
Temp_One : 20 rows, 15 columns
Temp_Two : 30 rows, 15 columns
Temp_Three : 50 rows, 15 columns
I then loaded these named ranges into a VBA macro:
Temp1 = Range("Temp_One").Value
Temp2 = Range("Temp_Two").Value
Temp3 = Range("Temp_Three").Value
In the macro, I did some calculations to add 15 rows of data to Temp1 and 25 rows of data to Temp2. (In the future, the number of non-empty rows will vary.)
Now, I want to stack Temp1 and Temp2, assign this to Temp3 (which would then have 40 non-empty values), and then sort Temp3 by the first column (a year variable).
I am not sure, however, how to stack and then sort the data. In something like SAS I could do the following:
data temp3;
set temp1 temp2;
run;
proc sort data=temp3;
by year;
run;
Thanks in advance for any advice.
Best regards,
Don