Code: SUM new merged tabs

eg8

New Member
Joined
Oct 4, 2011
Messages
7
I am working through a macro and have one final update to make. The macro is merging worksheets from a specified folder and then creating a 'Master' Sheet which takes the SUM of a specified cell from all other sheets besides the Master. Currently I wrote into the code:

Code:
   Range("D7").Select
   ActiveCell.FormulaR1C1 = "=AVERAGE('FTE SUMMARY:FTE SUMMARY (8)'!RC)"

The problem is (8) may not always be the final FTE summary. There will be times where there are up to 20 sheets it is pulling off of and it will always be a different number.

Is there a way to have that pull from all active sheets except the 'Master' sheet? Appreciate any advising!!

Here is more of the code if it helps, but it was a manual record:
Code:
Sub Master_Update()
'
' Master_Update Macro
'

'
    Sheets.Add After:=Sheets(Sheets.Count)
    ActiveCell.FormulaR1C1 = "MASTER"
    Range("A2").Select
    Sheets("Sheet10").Select
    Sheets("Sheet10").Name = "MASTER"
    ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
    Sheets("FTE SUMMARY").Select
    Columns("A:G").Select
    Selection.Copy
    ActiveWindow.ScrollWorkbookTabs Position:=xlLast
    Sheets("MASTER").Select
    ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
    Sheets("FTE SUMMARY").Select
    ActiveWindow.ScrollWorkbookTabs Position:=xlLast
    Sheets("MASTER").Select
    Columns("A:G").Select
    ActiveSheet.Paste
    Range("A1").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "MASTER"
    Range("A2").Select
    Selection.ClearContents
    Columns("C:C").Select
    Selection.EntireColumn.Hidden = True
    Range("D7").Select
    ActiveCell.FormulaR1C1 = "=AVERAGE('FTE SUMMARY:FTE SUMMARY (8)'!RC)"
    Range("D7").Select
    Selection.Copy
    Range("D8:D11,D13:D20").Select
    Range("D13").Activate
    ActiveWindow.SmallScroll Down:=9
    Range("D8:D11,D13:D20,D22:D41").Select
    Range("D22").Activate
    ActiveWindow.SmallScroll Down:=21
    Range("D8:D11,D13:D20,D22:D41,D43:D66").Select
    Range("D43").Activate
    ActiveWindow.SmallScroll Down:=21
    Range("D8:D11,D13:D20,D22:D41,D43:D66,D68:D69,D71:D75,D77:D88").Select
    Range("D77").Activate
    ActiveWindow.SmallScroll Down:=24
    Range( _
        "D8:D11,D13:D20,D22:D41,D43:D66,D68:D69,D71:D75,D77:D88,D90:D98,D100:D104"). _
        Select
    Range("D100").Activate
    Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    ActiveWindow.SmallScroll Down:=-162
    Range("E7").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=SUM('FTE SUMMARY:FTE SUMMARY (8)'!RC)"
    Range("E7").Select
    Selection.Copy
    Range("E8:E11,E13:E20").Select
    Range("E13").Activate
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
bump to see if anyone knows how to do this? It's the last piece of my macro and I can't seem to figure it out.

Thanks!!!
EG
 
Upvote 0

Forum statistics

Threads
1,224,589
Messages
6,179,744
Members
452,940
Latest member
rootytrip

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