I'm attempting to consolidate Divisional Sheets into a Corporate Summary. I've searched the net for a week on this subject and have not found a working solution. The following code is a compilation of code I've found
Option Explicit
Public Sub ImportData()
Dim shArray() As Variant
Dim sh() As Variant
Dim x() As Variant
Dim n As Integer
Dim i As Integer
Application.ScreenUpdating = False
n = Sheets.Count
ReDim sh(n), shArray(n)
For i = 1 To Sheets.Count
sh(i) = Sheets(i).Name
Debug.Print sh(i)
Next
For i = 1 To n - 1
sh(i) = Worksheets(i + 1).Name
shArray(i) = Array("'" & sh(i) & "'!R1C1:R70C13")
Next i
x = shArray
Worksheets("Consolidated").Range("A1").Consolidate _
Sources:=x, _
Function:=xlSum
Application.ScreenUpdating = True
End Sub
I get a "Type Mismatch" error at this line of code
Worksheets("Consolidated").Range("A1").Consolidate _
Sources:=x, _
Function:=xlSum
I can do this other ways but this is part of a much larger monthly consolidation process. I'd appreciate it if you could look at the attached workbook and give me some direction.
J
Bookmarks