View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Robinson[_2_] Jim Robinson[_2_] is offline
external usenet poster
 
Posts: 5
Default what is the Excel macro command equivalent to "end up"

Thanks for the reply KL,
Not quite. First the macro runs a routine which finds the largest number in
a list (auto filter to 10 command). This works OK. Next I want to go to the
cell where that number is located and copy the contents of that cell and the
one to the right of it and then paste what I copied to another location.
The autofilter command hides all the rows in the list except the row that
contains the largest number. So, depending on the list, various rows get
hidden.
When I tried to make a "record keystrokes" macro do this, I used the end up
keys to go to the cell that contained the largest number. Then I used shift
right to highlight the two cells. Then I used ctrl V to past the copied
information elsewhere.
However, the macro didn't do the equivalent of end up. It recorded the
actual cell that end up took me to. So, when I run the macro, it goes to
that specific cell every time even though that cell may not now contain the
largest value in the list.


"KL" wrote:

Hi Jim,

Is this what you ara after?

Sub test()
With ActiveSheet
.Range("A25:B25")=.Cells(65536, "A").End(xlUp).Resize(, 2)
End With
End Sub


Regards,
KL


"Jim Robinson" wrote in message
...
I am trying to get a macro to go to the equivalent of the keystrokes end up
no matter where end up takes me. However, the record keystrokes macro
actually goes to the specific cell that end up took me when I recorded the
macro no matter where end up now takes me.

What I want the macro to do is as follows.

end, up, shift, right ctrl C, goto A25, ctrl V

In other words go up to the first cell with data, copy that cell and the
one
to the right of it, and paste the copied data to row 25 columns A & B.