Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all :)
I have a nice little spreadsheet (well not so little) and a requirement in a column to sum preceeding columns of data. However I don't want to include hidden columns. I found this nice little vba programming on a site somewhere (have to love google). And it works perfectly if summing cells that are in a range i.e. A1:A10. Function VisTotal(Rg As Range) Dim x, tot Application.Volatile tot = 0 For Each x In Rg If x.ColumnWidth = 0 Or x.RowHeight = 0 Then Else tot = tot + x Next VisTotal = tot End Function However it does not work if the range is not consistent i.e. A1,A4,A10. It will work if I refer to named ranges, however I would need to create over 200 named ranges for this (bit of a job). Any ideas on how this VBA could be modified so it will deal with a non consistent range like A1,A4,A10?? Regards James |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subtoal excluding hidden columns | Excel Worksheet Functions | |||
Excluding formulas in hidden cells? | Excel Worksheet Functions | |||
Counting non-blank cells in a column, excluding hidden rows | Excel Worksheet Functions | |||
Need to sum columns, excluding hidden columns. | Excel Discussion (Misc queries) | |||
Need to sum columns, excluding hidden ones - like 'subtotal' for r | Excel Discussion (Misc queries) |