Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I make a macro seek the botom of a list?

I'm trying to copy data from a file and paste it at the bottom of other data
using a macro. manually, i would copy the selection toggle to my other open
sheet, press CTRL <down to jump to the bottom of the data and then paste.
when i try this in a macro it always jumps to a specific cell rather than a
relitive one. anyone know how to rewrite the VB code to make this relitive?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default How do I make a macro seek the botom of a list?

Hi,

In a macro this would find the last used cell in colum A of the active sheet

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

So we add 1 to that to get the empty cell below

LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row+1

And to turn that into a range to paste into we could use

Range("A" & Lastrow).pastespecial

or whatever type of paste you want to do
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"chads_vstream" wrote:

I'm trying to copy data from a file and paste it at the bottom of other data
using a macro. manually, i would copy the selection toggle to my other open
sheet, press CTRL <down to jump to the bottom of the data and then paste.
when i try this in a macro it always jumps to a specific cell rather than a
relitive one. anyone know how to rewrite the VB code to make this relitive?

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
how I will gat count rows number and r botom coner 2003 excel Excel Discussion (Misc queries) 1 December 3rd 09 01:34 PM
Macro to make a cum list veljo yahoo.com> Excel Worksheet Functions 0 July 14th 06 11:49 AM
the right botom does not work in excel 2003 Drussilla Excel Discussion (Misc queries) 1 July 4th 06 07:10 PM
Goal Seek - Why make the PV negative? Mytpoet67 Excel Discussion (Misc queries) 1 January 13th 05 02:51 AM


All times are GMT +1. The time now is 07:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"