Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Jumping back to a cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Jumping back to a cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Jumping back to a cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Jumping back to a cell

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
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
Cursor jumping to next cell Den Excel Discussion (Misc queries) 2 March 11th 09 05:25 PM
JUMPING TO THE NEAREST FORMULA CONTAINING CELL FARAZ QURESHI Excel Discussion (Misc queries) 4 January 14th 09 05:53 PM
Jumping reference cell in dependent cell formula jpeterspro Excel Worksheet Functions 1 November 28th 07 10:34 AM
Jumping to a certain cell The Fool on the Hill Excel Discussion (Misc queries) 3 May 12th 07 05:07 PM
Jumping to the next cell automaticly Amarilla Excel Discussion (Misc queries) 3 October 26th 06 03:08 AM


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