Hi
Can anyone help with how to call the above function properly ?
Dim ws As Worksheet
Dim tCells As Ranges
Dim tcell As Range
On Error Resume Next
For Each ws In ActiveWorkbook.Sheets
ws.Activate ' I know some folk say you don't need this, but I always seem to
For Each tbl In ws.ListObjects
If tbl.name <> "Tbl_Testertable" Then
' loop through columns applying totals
For Each tcell In tbl.HeaderRowRange.Cells
If tcell.Value Like "*Currency*" Then
tcell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
With Selection
.Style = "Comma" ' this appears to be working nicely
.ShowTotals = True ' not sure if this bit is working or not
.TotalsCalculation = xlTotalsCalculationSum' this bit definitely not working
End With
End If
Next tcell
End If
Next tbl
Next ws
End Sub
Can anyone help with how to call the above function properly ?
Dim ws As Worksheet
Dim tCells As Ranges
Dim tcell As Range
On Error Resume Next
For Each ws In ActiveWorkbook.Sheets
ws.Activate ' I know some folk say you don't need this, but I always seem to
For Each tbl In ws.ListObjects
If tbl.name <> "Tbl_Testertable" Then
' loop through columns applying totals
For Each tcell In tbl.HeaderRowRange.Cells
If tcell.Value Like "*Currency*" Then
tcell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
With Selection
.Style = "Comma" ' this appears to be working nicely
.ShowTotals = True ' not sure if this bit is working or not
.TotalsCalculation = xlTotalsCalculationSum' this bit definitely not working
End With
End If
Next tcell
End If
Next tbl
Next ws
End Sub