View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Selecting a cell from an index

Hi
try something like the following:

Sub select_high()
Dim row_index As Long
Dim rng As Range
Set rng = ActiveSheet.Range("A1:A10")
With Application.WorksheetFunction
row_index = .Match(.Max(rng), rng, 0)
End With
ActiveSheet.Cells(row_index, "A").Select
End Sub



--
Regards
Frank Kabel
Frankfurt, Germany


Hello,
I'm looking to set a cell as the 'activecell' from an index of cells.
What I need is when activating a command button it sets as the active
cell in a range of cells the one with the highest value.

For example: A1 = 1, A2 = 3, A3 = 10, A4 = 6
utilizing the command button sets A3 as the
activecell

any help would be appreciated


---
Message posted from http://www.ExcelForum.com/