ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Accessing data-subtotal via VB (https://www.excelbanter.com/excel-programming/400987-accessing-data-subtotal-via-vbulletin.html)

RocketMan[_2_]

Accessing data-subtotal via VB
 
I have a spreadsheet that already has subtotals generated via menu
(Data - Subtotal). Is there a way to get those subtotals via VB
without resorting to using the row number?

THANKS
John


Bob Phillips

Accessing data-subtotal via VB
 
Maybe something like this

LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To LastRow
If Cells(i, "A").Value Like "*Total*" Then
'do something with the value in the adjacent cell Cells(i,
"B").Value
End If
Next i


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"RocketMan" wrote in message
ups.com...
I have a spreadsheet that already has subtotals generated via menu
(Data - Subtotal). Is there a way to get those subtotals via VB
without resorting to using the row number?

THANKS
John





All times are GMT +1. The time now is 11:24 AM.

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