Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using PivotSelect method to find the top of a range
Hi
I have the following code, which selects the range containing all the labels of the row field "Combination" in the pivot table "Combinations". It then sets the value of lngRowStart as the row number of the active cell - this should be the top (i.e. first) of the labels in this range. ActiveSheet.PivotTables("Combinations").PivotSelec t "Combination[All]", xlLabelOnly lngRowStart = ActiveCell.Row Do While ActiveCell.Value < "" lngRowEnd = ActiveCell.Row ActiveCell.Offset(1, 0).Activate Loop The problem is that frequently the top of the range is not selected. Sometimes the active cell is the bottom (i.e. last) of the labels in the range, meaning that the lngRowStart is assigned the same value as lngRowEnd (not ideal in the context of this macro). Can anyone suggest either an alternative way to get the top and bottom row numbers of this range, or an alternative argument for the PivotSelect method to specify that the top cell has to be active in the selection? Thanks -- There are 10 types of people in the world - those who understand binary and those who don't. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Set range with Find method | Excel Discussion (Misc queries) | |||
Find method fails in hidden range | Excel Programming | |||
PivotSelect | Excel Programming | |||
Pivottable Pivotselect string | Excel Programming | |||
range.find method called into a VBA function (problem) | Excel Programming |