Update pivot table from hidden sheets

JFCLUK

New Member
Joined
May 12, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I have 8 data sources in separate sheets

I run a macro to consolidate all data into one sheet "MASTER"

I have a pivot table on sheet "REPORT"

The data sources are confidential. I want to hide these sheets and hide "MASTER"

When I hide the source sheets and "MASTER" the pivot table will not update I get a runtime error '1004' Select method of Worksheet class failed.

Ideally I'd like to make the source sheets and "MASTER" veryhidden.

Any help and guidance to resolve would be most appreciated.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
The challenge I'm having could stem from when I consolidate all of the data into "MASTER". I'm getting an error when the code reads the 5th line Sheets("Master").Select

Sub POPULATE_MASTER()

Dim sourceSheet As Worksheet
Set sourceSheet = ActiveSheet

'DELETE OLD DATA FROM MASTER_NEW
Sheets("MASTER").Select
Cells.Select
'Range("A10000").Activate
Selection.Delete Shift:=xlUp
Range("A1").Select
'COPY HEADERS FROM HEADERS_NEW

Worksheets("HEADERS").Activate

Rows("1:2").Select

Selection.Copy

Worksheets("MASTER").Activate

ActiveSheet.Paste Destination:=Worksheets("MASTER").Range("A1")

Columns("A:A").Select
Application.CutCopyMode = False

'GET DATA FROM ALL OHER DEPARTMENT TABS


Worksheets("SOURCE1").Activate
Range("a8").Select
On Error Resume Next
Set mylastcell = Cells(1, 1).SpecialCells(xlLastCell)
mylastcelladd = Cells(mylastcell.Row, mylastcell.Column).Address
myrange = "a8:" & mylastcelladd
Range(myrange).Select
Selection.Copy

Worksheets("MASTER").Activate

Range("A" & Rows.Count).End(xlUp).Offset(1).Select

Selection.PasteSpecial xlPasteValues
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,376
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top