Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've been thinking about this for a while and have had no luck. I need to
subtotal items that are in a column. The column always begins at B5 but it could be of any length. I have tried to determine the end of the column with two approaches: 1. Find the first blank at the end of the column and use the row value of that cell to set the range; 2. Or, just look at all the cells in column B with Range("B65536").End(xlUp).Row. Neither has worked. I figure once I can set the row, I can separate out and subtotal the items by counting the unique items and making a loop through the range. Of course, there is probably an easier way. I'm just running out of idea. Any help offered will be greatly appreciated. Thank-you very much. Yobrokerboy. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To get the last used row
dim last row as long lastrow = cells(row.count,2).end(xlup).row (the 2 above refers to column 2, change as required or use the column letter as "B") but... why not use subtotals - it is much simpler than writing the code -- Cheers Nigel "yobrokerboy" wrote in message ... I've been thinking about this for a while and have had no luck. I need to subtotal items that are in a column. The column always begins at B5 but it could be of any length. I have tried to determine the end of the column with two approaches: 1. Find the first blank at the end of the column and use the row value of that cell to set the range; 2. Or, just look at all the cells in column B with Range("B65536").End(xlUp).Row. Neither has worked. I figure once I can set the row, I can separate out and subtotal the items by counting the unique items and making a loop through the range. Of course, there is probably an easier way. I'm just running out of idea. Any help offered will be greatly appreciated. Thank-you very much. Yobrokerboy. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Vary the Range in a Function | Excel Worksheet Functions | |||
How do I create a macro that will select a range that can vary in | Excel Discussion (Misc queries) | |||
In excel, how do I vary a cell over a data range & see its effect? | Charts and Charting in Excel | |||
INDIRECT / Setting to vary a range? | Excel Discussion (Misc queries) | |||
How can I vary graph color by range value | Charts and Charting in Excel |