Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I filter and then want to select only those cells showing and give them a
range name, what's the syntax? I tried xllastrow but that gives everything. I also tried putting something like ...for every activecell in range but that also gave me everything. Is this possible or am I wishing too hard? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Try the visible cells instead: debug.print ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTy peVisible).Address -- Regards, Sébastien <http://www.ondemandanalysis.com "Rominall" wrote: If I filter and then want to select only those cells showing and give them a range name, what's the syntax? I tried xllastrow but that gives everything. I also tried putting something like ...for every activecell in range but that also gave me everything. Is this possible or am I wishing too hard? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So how does it go in the name statement?
ActiveWorkbook.Names.Add Name:="Any", Refersto ???????? "sebastienm" wrote: Hi, Try the visible cells instead: debug.print ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTy peVisible).Address -- Regards, Sébastien <http://www.ondemandanalysis.com "Rominall" wrote: If I filter and then want to select only those cells showing and give them a range name, what's the syntax? I tried xllastrow but that gives everything. I also tried putting something like ...for every activecell in range but that also gave me everything. Is this possible or am I wishing too hard? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
something like:
dim rg as range, str as string set rg=ActiveSheet.AutoFilter.Range.SpecialCells(xlCel lTypeVisible) srt = "'" & rg.parent.name & "'!" & rg.address(true,true) ActiveWorkbook.Names.Add Name:="Any", Refersto:= "=" & str ' !!! don't forget the '=' in the address string RefersTo eg: "=sheet1!A1:F10" -- Regards, Sébastien <http://www.ondemandanalysis.com "Rominall" wrote: So how does it go in the name statement? ActiveWorkbook.Names.Add Name:="Any", Refersto ???????? "sebastienm" wrote: Hi, Try the visible cells instead: debug.print ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTy peVisible).Address -- Regards, Sébastien <http://www.ondemandanalysis.com "Rominall" wrote: If I filter and then want to select only those cells showing and give them a range name, what's the syntax? I tried xllastrow but that gives everything. I also tried putting something like ...for every activecell in range but that also gave me everything. Is this possible or am I wishing too hard? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select Case for Active Worksheet syntax. | Excel Programming | |||
Correct syntax for Active Worksheet | Excel Programming | |||
Filter range of only active cells??? | Excel Worksheet Functions | |||
Help: Visual Basic Syntax | Excel Programming | |||
More Visual Basic Syntax | Excel Programming |