Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi,
On one worksheet in my workbook, I have an outline with expandable and collapsable rows (using the group function). In another worksheet, I have different buttons which runs different macros that will link me to the sections of the outline that I want expanded (while the rest remains collapsed). I was able to get a macro to work using absolute values for a cell position, but I have been unsuccesful trying to work with name ranges. This is a problem, as I frequently add new rows to the outline so I'm constantly having to update the macro. Can someone help me put relative values in the macro so that it will adjust as I add new rows? I think the best way to tackle this might be to use named ranges. Here's the script that worked with absolute values: Sub SQ5() Sheets("Horizontal").Select Rows(2).ShowDetail = True Rows(96).ShowDetail = True Rows(97).ShowDetail = True End Sub Here's what I wrote that is *not* working with ranges. Sub SQ5() Sheets("Horizontal").Select Rows(2).ShowDetail = True Range("IIA").ShowDetail = True Range("SV").ShowDetail = True End Sub FYI, I'm fairly new to macros. Thank you in advance for whatever help you can provide! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to Link named ranges from multiple Workbooks into a single Wo. | Excel Discussion (Misc queries) | |||
Named Cell Ranges | Excel Discussion (Misc queries) | |||
Problem with graph ranges | Charts and Charting in Excel | |||
Excel2K: Is it possible to use dynamic named ranges in custom data validation formula? | Excel Discussion (Misc queries) | |||
Named dynamic ranges, copied worksheets and graph source data | Charts and Charting in Excel |