Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Basic question....syntax on active cells from a filter

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Basic question....syntax on active cells from a filter

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Basic question....syntax on active cells from a filter

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Basic question....syntax on active cells from a filter

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select Case for Active Worksheet syntax. mikeburg[_43_] Excel Programming 2 December 2nd 05 12:26 AM
Correct syntax for Active Worksheet [email protected] Excel Programming 4 July 3rd 05 09:04 PM
Filter range of only active cells??? malik641 Excel Worksheet Functions 3 June 17th 05 06:54 PM
Help: Visual Basic Syntax Al[_12_] Excel Programming 7 November 3rd 03 10:53 AM
More Visual Basic Syntax Al[_12_] Excel Programming 2 November 3rd 03 07:25 AM


All times are GMT +1. The time now is 09:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"