Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default ActiveCell.Offset on filtered data

Try this clever routine, I think provided by Tom Ogilvy in the past.

Sub AutoFilterSelectNext()
Dim rng As Range, Rng1 As Range
Dim iCol As Long

iCol = ActiveCell.Column
Set rng = ActiveSheet.AutoFilter.Range
Set rng = Intersect(rng, Columns(iCol))

If rng Is Nothing Then Exit Sub

Set rng = Range(ActiveCell.Offset(1, _
iCol - ActiveCell.Column), rng(rng.Count))

On Error Resume Next
Set Rng1 = rng.SpecialCells(xlVisible)
On Error GoTo 0

If Not Rng1 Is Nothing Then
Rng1(1).Select
End If
End Sub


Steven wrote:
I want to do ActiveCell.Offset(1, 0).Range("A1:A1").Select on a column that
is filtered. My problem is that I want it to go to the next visible row.
When I do this currently if the row is not visible it will still offset to
the hidden row. Is there a way I can make it automatically offset to the
next visible row?

Thank you for your help.

Steven


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
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
ActiveCell Offset rnrss[_2_] Excel Programming 0 October 7th 05 10:12 AM
Activecell Offset Mark Excel Programming 2 December 7th 04 04:57 PM
ActiveCell.Offset w/ VBA Bob Umlas[_3_] Excel Programming 2 September 4th 04 02:58 PM
activecell offset rvik Excel Programming 1 December 24th 03 07:47 AM


All times are GMT +1. The time now is 09:23 PM.

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"