Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.setup
|
|||
|
|||
![]()
I am running this macro that sums the range and place the total at the end of
the range. The macro will work on the current worksheet, but will not automatically calculate the sum on the other worksheet. Is there something wrong with the coding? Thanks! Sub AddTotal() Dim wks As Worksheet For Each wks In ActiveWorkbook.Worksheets On Error Resume Next Set rng2 = Range("K8").End(xlDown) Set rng = Range("k8", rng2) rng2.Offset(2, 0).Formula = "=SUM(" & rng.Address & ")" rng2.Offset(2, 0).Borders(xlDiagonalDown).LineStyle = xlNone rng2.Offset(2, 0).Borders(xlDiagonalUp).LineStyle = xlNone rng2.Offset(2, 0).Borders(xlEdgeLeft).LineStyle = xlNone rng2.Offset(2, 0).Borders(xlEdgeRight).LineStyle = xlNone With rng2.Offset(2, 0).Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With rng2.Offset(2, 0).Borders(xlEdgeBottom) .LineStyle = xlDouble .Weight = xlThick .ColorIndex = xlAutomatic End With Next wks End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protect Workbook vs Worksheet?? | Excel Worksheet Functions | |||
Inserting Filtered RC cell information into other worksheets | Excel Discussion (Misc queries) | |||
Search/Match between 2 x separate Worksheets and populate result in third worksheet | Excel Discussion (Misc queries) | |||
Weekly Transaction Processing | Excel Worksheet Functions | |||
copyright and worksheet protection | Excel Discussion (Misc queries) |