D
DGillham
Hi
I am using an autofilter on my data and need to be able to add a total
at the bottom of that filter that tells me how many rows are included
in the filter. Microsoft kindly provides the following code:
Dim UpperLeftCorner As Range
' UpperLeftCorner should be set to the upper-left
' corner of the list range:
Set UpperLeftCorner = Sheets("Sheet1").Range("A4")
RowCount = -1
For Each area In _
UpperLeftCorner.CurrentRegion.SpecialCells(xlVisible).Areas
RowCount = RowCount + area.Rows.Count
Next
MsgBox RowCount
This works fine, by rather than a message box I would like to actually
add this total to the worksheet - any ideas how this can be done?
Thanks
Darren
I am using an autofilter on my data and need to be able to add a total
at the bottom of that filter that tells me how many rows are included
in the filter. Microsoft kindly provides the following code:
Dim UpperLeftCorner As Range
' UpperLeftCorner should be set to the upper-left
' corner of the list range:
Set UpperLeftCorner = Sheets("Sheet1").Range("A4")
RowCount = -1
For Each area In _
UpperLeftCorner.CurrentRegion.SpecialCells(xlVisible).Areas
RowCount = RowCount + area.Rows.Count
Next
MsgBox RowCount
This works fine, by rather than a message box I would like to actually
add this total to the worksheet - any ideas how this can be done?
Thanks
Darren