Consolidation refresh (update)

C

CAM

Hello,

I am having a problem with my coding it seems my coding in consolidation
doesn't refresh properly when I run the marco (see below), but when I go to
Data-> Consolidation and run it thru the consolidation button I have no
problems it updates properly. I am using Excel 2007. What can code can be
missing? Any tips will be appreicated. Thank you in advance.

Cheers.


Sub Refresh()
'Refresh sales connection
ActiveWorkbook.Connections("Query from SO1").Refresh

'Select sheet, cell range and clear inputted cells.
Worksheets("Revenue").Range("A3:D59").ClearContents

'Refresh sales connection
ActiveWorkbook.Connections("Query from SO1").Refresh
ActiveWorkbook.Connections("Query from Exp_Spon").Refresh

'Revenue worksheet consolidation
Worksheets("Revenue").Range("A3").consolidate Sources:=Array( _
"'H:\NNA General Document Folder\Conference\Conference
2009\Budget\[Conference Budget Actual 2009.xlsm]Revenue'!R3C6:R200000C9" _
, _
"'H:\NNA General Document Folder\Conference\Conference
2009\Budget\[Conference Budget Actual 2009.xlsm]Revenue'!R3C11:R200000C14" _
), Function:=xlSum, TopRow:=False, LeftColumn:=True,
CreateLinks:=False

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top