I'm having problems with my Macro. It has to grab info from many
spreadsheets and output it to another. For some reason I can't change
the focus correctly and the output ends up on another worksheet (the
one calling the macro).
The code snippit below should output this to a spreadsheet in five
columns, but it never puts anything on this spreadsheet at all.

Any ideas/solutions would be greatly appreciated.

Set objExcelOut = New Excel.Application
objExcelOut.Visible = True
Set objWrkBookOut = objExcelOut.Workbooks.Open(outFilePath &
outFileName)
Set objWrkSheetOut = objWrkBookOut.Worksheets(shtNameOut)

'write the values to the output file
objWrkSheetOut.Activate
objWrkSheetOut.Range("A" & (rowTotal + 1)).Activate
For c = 0 To inColCount
For r = 0 To actualRows
ActiveCell.Value = costCentre
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = EndDate(c)
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = groupID(r)
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = unit(r, c)
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = amount
ActiveCell.Offset(1, -4).Activate
rowTotal = rowTotal + 1
Next r
Next c