Hi. Thanks for this. It
half works.
I've added the line as you suggested:
Quote:
Function SumCat(WorkRng As Range)
'
' SumCat Function
'
' Calculates cells formatted as "Total Category"
' Example: =SUMCAT(A1:C9)
'
Dim rng As Range
Dim xSum As Long
Application.Volatile
For Each rng In WorkRng
' Finds cells with "Total Category" stylename
If rng.Style = "Total Category" Then
xSum = xSum + rng.Value
End If
Next
SumCat = xSum
End Function
|
The "Insert Row" macro (see code in first post) now seems to work fine, but I'm still getting the error after running the "Delete Row" macro (code below).
Quote:
Sub DeleteRow()
'
' DeleteRow Macro
'
response = MsgBox("Are you sure you want to remove this row?", vbYesNo)
If response = vbYes Then
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Delete Shift:=xlUp
Else
Exit Sub
End If
End Sub
|
As before, deleting a row manually does not result in the "#VALUE!" error.