Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
within vb I read some values from my worksheet into a 2-dim table. The values of the cells and their references are kept in this table. After a sort, I want to change the property of the cells that keep the 5 highest values. So, next I want to jump back to these cells by their cell reference that is kept in the second column of my table. Unfortunately, after numerous attempts with e.g. ActiveCell etc... I did not get it to work Does somebody have an idea Highly appreciated ZAkar. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could use the LARGE() worksheet function and save
yourself some time If your array is sorted then you could re-size it Sub GetTop5() Dim MyArray As Variant 'MUST be variant 'load the data MyArray = Range("MyList") MyArray = SortTheArray(MyArray) ' drop it back somewhere Range("G1:G5") = MyArray End Sub SortTheArray is my own function that gets back the top 5 cells If your array has 5 rows & two columns, where column 1 is the value and column 2 the cells address dim Target as Range Target = Range("G1") for rw = 0 to 4 Target.Offset(i,0) = mArray(rw,0) Target.Offset(i,1) = mArray(rw,1) next -----Original Message----- Hello, within vb I read some values from my worksheet into a 2- dim table. The values of the cells and their references are kept in this table. After a sort, I want to change the property of the cells that keep the 5 highest values. So, next I want to jump back to these cells by their cell reference that is kept in the second column of my table. Unfortunately, after numerous attempts with e.g. ActiveCell etc... I did not get it to work. Does somebody have an idea ? Highly appreciated, ZAkar. . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if you use the .address Property to store the cell reference, you can use the Range.Method to retrieve it
MyArray(x, y) = MyCell.Addres Range(MyArray(x, y)).Select |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much, Chris. It works now! Also Thanks to Patrick Molloy, appreciate your help a lot
Grtz ZAkar ----- chris wrote: ---- if you use the .address Property to store the cell reference, you can use the Range.Method to retrieve it MyArray(x, y) = MyCell.Addres Range(MyArray(x, y)).Select |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cursor jumping to next cell | Excel Discussion (Misc queries) | |||
JUMPING TO THE NEAREST FORMULA CONTAINING CELL | Excel Discussion (Misc queries) | |||
Jumping reference cell in dependent cell formula | Excel Worksheet Functions | |||
Jumping to a certain cell | Excel Discussion (Misc queries) | |||
Jumping to the next cell automaticly | Excel Discussion (Misc queries) |