Name a Range - Macro

D

Danny

I have a large workbook with more than a thousand rows. After I sort the
rows, they are separated into 18 groups. I total each group by using sum in
active cell macro.

I'd like to name each total so I add which total I want to add.

If I define a name for each total, the macro would read, example:
ActiveWorkbook.Names.Add Name:="Total1", RefersToR1C1:="=Sheet1!R15C13"
the above macro command refers ro Row 15, Column 13

When I add more date to the workbook and re-sort it, the named range no
longer refers to the total of group one.

How can I write a macro defining a range name in this situation?

Note that I before sorting, I would delete the named ranges then, sum each
group and re-name the total for each group.

Thanks in advance.
 

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