Macro to go to the last value

  • Thread starter Thread starter tc
  • Start date Start date
T

tc

Hi. How do i create a macro that will go to the last value in a given
column?
 
Hi,

This retuens the last value in column A
Sub stantial()
myvalue = Range("A" & Cells(Cells.Rows.Count, "A").End(xlUp).Row).Value
End Sub

This selects the last value on column A
Sub stantial()
Range("A" & Cells(Cells.Rows.Count, "A").End(xlUp).Row).Select
End Sub

Mike
 
Hello
Use the macro recorder:
Tools, Macro, New Macro
Input a name for your macro
Validate with OK
Press both Ctrl and End keys
Stop the recorder

Check the vba code written in the new module created.

HTH
Cordially
Pascal
 
to select the last occupied cell in column A:

n = Cells(Rows.Count, "A").End(xlUp).Row
Cells(n, "A").Select
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top