Ik heb volgende macro van de site van Ron de Bruin gebruikt alleen zou ik graag 3 aanpassingen willen doen alleen ik kom er niet uit
De aanpassingen die ik graag erin wil verwerken zijn
1. Alleen de sheet 2 tot de 1 laatste sheet.
2. De volgende formule =AANTAL.ALS(XXXX!A:A;"*")-1 (Zowel in een engelse en Nederlandse versie van excel
3. Eind totaal van de som (Kolom A de tekst Totaal en kolom B de som
De aanpassingen die ik graag erin wil verwerken zijn
1. Alleen de sheet 2 tot de 1 laatste sheet.
2. De volgende formule =AANTAL.ALS(XXXX!A:A;"*")-1 (Zowel in een engelse en Nederlandse versie van excel
3. Eind totaal van de som (Kolom A de tekst Totaal en kolom B de som
Code:
Sub Summary_All_Worksheets_With_Formulas()
Dim Sh As Worksheet
Dim Newsh As Worksheet
Dim myCell As Range
Dim ColNum As Integer
Dim RwNum As Long
Dim Basebook As Workbook
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
'Delete the sheet "Totaal" if it exist
Application.DisplayAlerts = False
On Error Resume Next
ThisWorkbook.Worksheets("Totaal").Delete
On Error GoTo 0
Application.DisplayAlerts = True
'Add a worksheet with the name "Totaal"
Set Basebook = ThisWorkbook
Set Newsh = Basebook.Worksheets.Add
Newsh.Name = "Totaal"
'The links to the first sheet will start in row 2
RwNum = 1
For Each Sh In Basebook.Worksheets
If Sh.Name <> Newsh.Name And Sh.Visible Then
ColNum = 1
RwNum = RwNum + 1
'Copy the sheet name in the A column
Newsh.Cells(RwNum, 1).Value = Sh.Name
For Each myCell In Sh.Range("A11") '<--Change the range
ColNum = ColNum + 1
Newsh.Cells(RwNum, ColNum).Formula = _
"='" & Sh.Name & "'!" & myCell.Address(False, False)
Next myCell
End If
Next Sh
Newsh.UsedRange.Columns.AutoFit
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub