PC Review


Reply
Thread Tools Rate Thread

How do I make a macro seek the botom of a list?

 
 
chads_vstream
Guest
Posts: n/a
 
      2nd Jun 2010
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 With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      2nd Jun 2010
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make a Macro Button Look the way I want it to, not from the list Amanda G Microsoft Word Document Management 1 26th Nov 2009 05:56 AM
Using a macro to make a list from results deemo85 Microsoft Excel Misc 1 2nd Jun 2008 02:43 PM
Using a macro to make a list from Results deemo85 Microsoft Excel New Users 1 2nd Jun 2008 02:01 PM
Macro to make a cum list =?Utf-8?B?dmVsam8=?= yahoo.com> Microsoft Excel Programming 0 19th Jul 2006 08:49 AM
Macro to make a cum list =?Utf-8?B?dmVsam8=?= yahoo.com> Microsoft Excel Worksheet Functions 0 14th Jul 2006 11:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:28 PM.