Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro needs updated Range name addresses
The range name "Current" needs to be a moving target so that when
something gets added at the bottom, the range updates itself. I tried dynamic ranges with =offset and that did not pan out. This range is used so that we can filter out rows with zeros in a certain column, which is what the range "criteria" is for. The problem with this macro right now is that I cannot properly assign the variable range1 to the range name "Current" given that this range name does exist, it just needs to be updated. I have experimented with quite a few commands but right now look on the 6th line down starting with ActiveWorkbook.Names.Add Name:="Current" = Selection Obviously that statement doesn't work or I would not be here typing this right now. Sub HideZeros() Dim range1 As range Application.Goto Reference:=range("start").Offset(1, 0) Set range1 = range(ActiveCell.End(xlDown), ActiveCell.Offset(0, 25)) Application.Goto Reference:=range1 ActiveWorkbook.Names.Add Name:="Current" = Selection range("Current").AdvancedFilter Action = xlFilterInPlace, _ CriteriaRange:=range("Criteria"), _ Unique:=False End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel cells randomly don't get updated unless each cell is updated | Excel Discussion (Misc queries) | |||
RANGE addresses. Getting from other cells. | Excel Worksheet Functions | |||
Sort Data auto on cell range when updated | Excel Programming | |||
Select updated data from a range of columns | Excel Worksheet Functions | |||
Translate range name passed as string to a custom function to range addresses! | Excel Programming |