Hi All,
I am trying to create macro for subtotaling rows:
Application.CutCopyMode = False
rw = Range(Range("A1"), Range("A1").EndxlDown)).Rows.Count
col = 16
Range("A1").Resize(rw, col).Select
Selection.subtotal GroupBy:=6, Function:=xlSum, TotalList:=Array(15, 16), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
My question are:
1. When there is only header and no records on sheet the macro return error message :
2. What is this "GroupBy:=6" syntax does? What if I change the number to 10?
3. Is there anyway to make the subtotal cels (starting from leftmost to right of the table where it contain subtotal amount) to automatically formatted in specific color, font, style?
Pardon me for asking so many questions. This thing is so new to me.
I am trying to create macro for subtotaling rows:
Application.CutCopyMode = False
rw = Range(Range("A1"), Range("A1").EndxlDown)).Rows.Count
col = 16
Range("A1").Resize(rw, col).Select
Selection.subtotal GroupBy:=6, Function:=xlSum, TotalList:=Array(15, 16), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
My question are:
1. When there is only header and no records on sheet the macro return error message :
2. What is this "GroupBy:=6" syntax does? What if I change the number to 10?
3. Is there anyway to make the subtotal cels (starting from leftmost to right of the table where it contain subtotal amount) to automatically formatted in specific color, font, style?
Pardon me for asking so many questions. This thing is so new to me.