Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro problem | Excel Discussion (Misc queries) | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Macro problem | Excel Discussion (Misc queries) | |||
Problem with a macro | Excel Programming |