![]() |
Selecting a cell from an index
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 activ 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 th activecell any help would be appreciate -- Message posted from http://www.ExcelForum.com |
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/ |
All times are GMT +1. The time now is 07:19 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com