How to jump to a groupeded cell

  • Thread starter Michiel via OfficeKB.com
  • Start date
M

Michiel via OfficeKB.com

Hi,

I have a macro that is grouping rows by the value in column A (col A is
sorted)
Above that I have 7 empty rows at the top which will not be grouped. These
rows are frozen.

Now, after running this macro I have this 7-row header and about 30 grouped
rows (which each comprise some 10 to hundreds of underlying rows). The first
grouped cell is FOR EXAMPLE Row 533 (thus rows 8-532 are hidden by the group
functionality)

I want to go to the first grouped row (In my example row 533). I f I use my
keyboard I do it like this:
I click in Cell A7 (the last frozen row)
I hit the keydown key on the keyboard once, and I am in the grouped cell.
Ready!

Now I want to do it by code.
I tried:

cells(7,1).Offset(rowOffset:=1).Activate

But then I indeed end up in row 8 instead of row 533 as planned.

Since the grouping depends on the data that I process, the 533rd row is not
fixed. It could also be 500 rows. So directly selecting the hard address is
no option.

Any idea/ suggestion. (Sorry for long story).

M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top