Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting the first row after a filtered range
I have a worksheet with information for about 18 nodes. I am able to locate
the data for a particular node and by using AutoFilter I can filter out the specific row which I require (always a single row). I want to copy this row to another sheet. xlCellTypeVisible does not work because there is visible data for other nodes. Thanks for your help. Farooq |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting the first row after a filtered range
Hi Farooq,
Try something like: '============= Public Sub Tester() Dim rng As Range Dim rng2 As Range Set rng = ActiveSheet.AutoFilter.Range Set rng = rng.Offset(1).Resize(rng.Rows.Count - 1) On Error Resume Next Set rng2 = rng.SpecialCells(xlCellTypeVisible) On Error Resume Next If Not rng2 Is Nothing Then rng2.Copy Destination:=Sheets(1).Range("A1") End If End Sub '<<============= --- Regards, Norman "Farooq Sheri" wrote in message ... I have a worksheet with information for about 18 nodes. I am able to locate the data for a particular node and by using AutoFilter I can filter out the specific row which I require (always a single row). I want to copy this row to another sheet. xlCellTypeVisible does not work because there is visible data for other nodes. Thanks for your help. Farooq |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting the first row after a filtered range
Thank you for pointing out the way. I used the following line in my code and
it worked Set rng = rng.Offset(1).Resize(rng.Rows.Count - 1) "Norman Jones" wrote: Hi Farooq, Try something like: '============= Public Sub Tester() Dim rng As Range Dim rng2 As Range Set rng = ActiveSheet.AutoFilter.Range Set rng = rng.Offset(1).Resize(rng.Rows.Count - 1) On Error Resume Next Set rng2 = rng.SpecialCells(xlCellTypeVisible) On Error Resume Next If Not rng2 Is Nothing Then rng2.Copy Destination:=Sheets(1).Range("A1") End If End Sub '<<============= --- Regards, Norman "Farooq Sheri" wrote in message ... I have a worksheet with information for about 18 nodes. I am able to locate the data for a particular node and by using AutoFilter I can filter out the specific row which I require (always a single row). I want to copy this row to another sheet. xlCellTypeVisible does not work because there is visible data for other nodes. Thanks for your help. Farooq |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting range in list of range names depending on a cell informa | Excel Discussion (Misc queries) | |||
Max Value within filtered range | Excel Programming | |||
traversing through a filtered range based on another filtered range | Excel Programming | |||
Selecting Filtered records only when AutoFilter is on | Excel Programming | |||
Selecting Filtered Items from Named range | Excel Programming |