Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CAM CAM is offline
external usenet poster
 
Posts: 65
Default Consolidating via vba not updating properly

Hello,

I create a code (below) using the macro recorder to refresh the data
connection and consolidate the sales figures. My problem is that the code
only seems to refresh the data connection, but the data is not consolidating
correctly. Now if I go to Data - Consolidate manually it works fine. How
can I have my code work correctly that will consolidate properly. I made
sure that I clear the contents before doing the consolidation. Can anyone
help me. Thank you in advance.

Cheers




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

'Consolidate revenue
'Revenue worksheet consolidation
Worksheets("Revenue").Range("A3").Consolidate Sources:=Array( _
"'Z:\General Folder\Sales\Budget\[Revenue
2009.xlsm]Revenue'!R3C6:R40000C9" _
, _
"'Z:\General Folder\Sales\Budget\[Revenue
2009.xlsm]Revenue'!R3C11:R20000C14" _
), Function:=xlSum, TopRow:=False, LeftColumn:=True,
CreateLinks:=False

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked sheets not updating properly with dual monitors PrattBratt Excel Worksheet Functions 1 September 3rd 09 08:13 PM
Excel - sumif not updating properly [email protected] Excel Discussion (Misc queries) 2 June 2nd 08 10:23 PM
Area Chart not refreshing/updating properly Ronald R. Dodge, Jr.[_2_] Excel Programming 3 March 13th 08 09:29 PM
Area Chart not refreshing/updating properly Ronald R. Dodge, Jr.[_2_] Charts and Charting in Excel 1 March 13th 08 09:29 PM
PivotChart not updating properly Piers Excel Discussion (Misc queries) 0 June 7th 07 11:33 AM


All times are GMT +1. The time now is 12:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"