Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default trouble with cell choice

Tom,
Thank You very much for another assistance.
Yours sincerely
Mark
-----Original Message-----
Public Function GetRange(lIdex as Long, MaxRow as Long)

as Range
Dim rng As Range, rng1 As Range
Dim llIndex As Long
Dim Maxrow as Long
With Worksheets("Sheet2")
If .AutoFilterMode Then
Set rng = .AutoFilter.Range
Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1,

1)
On Error Resume Next
Set rng1 = rng.SpecialCells(xlVisible)
On Error GoTo 0
End If
End With
If Not rng1 Is Nothing Then
MaxRow = rng1.count
llIndex = 0
For Each cell In rng1
llIndex = llIndex + 1
If llIndex = lIdex Then
set GetRange = Cell
Exit For
End If
Next
Else
MaxRow = 0
set GetRange = Nothing
End If
End Function

Call this function with the number of the visible row you

want in the
filter.
Dim MaxVisible as Long
set myRow = GetRange(1,MaxVisible).EntireRow
msgbox "1st record of " & MaxVisible & " records is at

absolute row: " &
myRow.row


as an example would set myRow to the first visible row

(below the header
row) and MaxVisible would tell you the number of visible

rows

If myRow is nothing, then Check MaxVisible - you might

have requested a row
that is more than the max visible.

--
Regards,
Tom Ogilvy




"Mark" wrote in message
...
Hi,
I have chosen criterion in my autofilter and i'd like
select some cell in first row with data selection.

Any offset does't work.

Can anyone assist ?

Best regards
Mark



.

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
list choice depending on the value in another cell James New Users to Excel 1 August 27th 09 03:44 PM
User choice listed in cell. Elzard Excel Worksheet Functions 3 February 24th 08 09:50 PM
Need to link dropdown box choice to another cell lrb Excel Discussion (Misc queries) 6 December 12th 07 08:08 PM
How do I set up a drop down choice in a cell CELL DROP DOWN MENU Excel Discussion (Misc queries) 3 May 14th 05 06:48 AM
limit choice in cell to one of two values; Excel Discussion (Misc queries) 3 February 18th 05 09:04 PM


All times are GMT +1. The time now is 08:41 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"