First of all, read about MS
Excel's objects[
^], because Sheet object and Worksheet object is not the same.
The best programming practice is to use code with context. To explain what i mean, do it:
1) Open or create few MS Excel Workbooks,
2) Activate first workbook and run this code:
For i = 1 To 30
Sheets(1).Range("A" & i) = i
Next i
3) Then activate another workbook and run above code
4) and so on...
What kind of results you can expect?
Each first worksheet for each workbook is filled in with values 1 to 30 in column A.
To properly load data in to correct worksheet, you need to do something like this:
Dim wsh As Worksheet
Set wsh = ThisWorkbook.Worksheets(1)
wsh.Range("A1") = 5
No matter how many times you'll be run the above code and no matter which workbook is active, the above code is running with context and insert the data into correct workbook/worksheet (only into this workbook where the code is placed).
I do not understand what you are trying to do, but if you update your question (use Improve question widget) and explain the exact problem, i'll upgrade my solution. Please, provide more details about used arrays and stored data.