Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Selection after filtering

Hi,

I have a database that filtered
Now I want to select the next row after the 4th. Given that I have filter
the next row is the 777
What code should I write in order to select the row that is show by the
filter has the next to the 4th , taking into account that this can be change
if the filter change

Regards
PM


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Selection after filtering

set rng = Activesheet.autofilter.Range.Columns(1)
set rng = rng.offset(1,0).Resize(rng.rows.count-1)
set rng = rng.specialcells(xlVisible)
set rng1 = nothing
i = 0
for each cell in rng
i = i + 1
if i = 5 then
set rng1 = cell
exit sub
end if
Next
rng1.Select

--
Regards,
Tom Ogilvy


"Pedro" wrote in message
...
Hi,

I have a database that filtered
Now I want to select the next row after the 4th. Given that I have filter
the next row is the 777
What code should I write in order to select the row that is show by the
filter has the next to the 4th , taking into account that this can be

change
if the filter change

Regards
PM




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Selection after filtering

Sub SelectFirstVisible()
Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range.Columns(1)
Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1)
On Error Resume Next
Set rng = rng.SpecialCells(xlVisible)
On Error GoTo 0
If Not rng Is Nothing Then
rng(1).Select
Else
MsgBox "No rows visible"
End If
End Sub

--
Regards,
Tom Ogilvy


"Pedro" wrote in message
...
Thanks Tom

Can you please explain what those steps do?
I attached a copy of the spreadsheet database I filtered it by the A
column(selecting 0009718) and by the C column (selecting Equities)
How can I select the 774 row (the one that is visible next to the 1st

row)?

Regards
Pedro


"Tom Ogilvy" wrote in message
...
set rng = Activesheet.autofilter.Range.Columns(1)
set rng = rng.offset(1,0).Resize(rng.rows.count-1)
set rng = rng.specialcells(xlVisible)
set rng1 = nothing
i = 0
for each cell in rng
i = i + 1
if i = 5 then
set rng1 = cell
exit sub
end if
Next
rng1.Select

--
Regards,
Tom Ogilvy


"Pedro" wrote in message
...
Hi,

I have a database that filtered
Now I want to select the next row after the 4th. Given that I have

filter
the next row is the 777
What code should I write in order to select the row that is show by

the
filter has the next to the 4th , taking into account that this can be

change
if the filter change

Regards
PM









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
Limiting selection in a cell AND linking that selection to a list Lisa Excel Discussion (Misc queries) 1 July 28th 09 05:00 PM
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
trouble filtering a list. Why isn't column filtering? Pat Excel Worksheet Functions 1 July 18th 05 03:30 PM
limit cell list selection based on the selection of another list lorraine Excel Worksheet Functions 2 December 14th 04 08:17 PM


All times are GMT +1. The time now is 08:42 AM.

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

About Us

"It's about Microsoft Excel"