ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Filters/Range/Summing (https://www.excelbanter.com/excel-programming/308028-filters-range-summing.html)

Dim DumbAss as Name

Filters/Range/Summing
 
I have a spreadsheet that is about a1:h1500 big and I use filters to show
only the data that I want to see.
My question is how do I use this code below that works fine and get it to
only sum the shown cells. For example rows shown could be various such as row
2,8,37,54,104 etc. So when I use the code below to highlite and sum the
ranges it still adds the hidden rows such as 3,4,5,6,7,9,10....etc

I have:

Private Sub CommandButton1_Click()
Dim AreaClick As Range
Dim AreaSum As Long
Windows("how spent 73104rev.xls").Activate
Sheets("ITA ").Select
Set AreaClick = Application.InputBox(prompt:="Please click on area to sum",
Title:="Auto Sum", Type:=8)
AreaSum = WorksheetFunction.Sum(AreaClick)
MsgBox (AreaSum)

End Sub


All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com