[pre]
Code:
MyValue = ws.Range("A1") '????
The above assigns to MyValue the Value in cell A1. It actually refers to a Range object, but Value is the default property of a range. It only works for one cell.
[pre][code].Cells(i, "A") = MyValue
[/pre]
The Above line assigns MyValue to the Value property of the cell in Row i, Column "A" of your Summary sheet. (.Cells is also a range object, with Value the default property again).
To copy a range of cells, if you want to copy them unchanged, you could use the Copy method of the Range object. The example from Excel's Help:
Worksheets("Sheet1"

.Range("A1:D4"

.Copy _
destination:=Worksheets("Sheet2"

.Range("E5"

[/code][/pre]
However, Luke's routine looks to be designed to summarize your data by creating one row in the Summary sheet for every other sheet in the workbook, and copying one cell to column "A". It could be extended to copy a different cell to columns B, C, D, etc. by repeating the MyValue/.Cells lines several times.
How is copying 26 columns and 300 rows for every worksheet a summarization?
Do you want to put formulas on your Summary sheet to calculate Sums, Averages, etc.?
Just some thoughts, I'm not taking over for Luke -- but your requirement doesn't seem clear to me.
~~~~~~~~~~~~~~~~~~~
OK, forgive my rambling, I have re-read your original requirement. Sounds like you want to retrieve a list of unique country codes in one Summary table, from all the other sheets?
I think this could be done with a pivot table, since they can take multiple source ranges, group fields, and eliminate blanks. This would give you a unique list of country codes.
It could also be done with some significant changes to Luke's previously posted code that loops through all the cells in column A of each imported sheet, finding country codes, and adding them to the Summary sheet. To eliminate duplicates, it could either use some fancy VBA footwork before putting the data on the Summary Sheet, or use various techniques to eliminate them after adding them. In Excel 2010 the macro could call the "Remove Duplicates" feature. In other versions, rely on filtering, and then delete the filtered rows.
Asa