PC Review


Reply
Thread Tools Rate Thread

Copy row to next available blank row

 
 
=?Utf-8?B?U2FyYWg=?=
Guest
Posts: n/a
 
      12th Mar 2007
Does anyone know how I can programatically copy the 1st 3 columns and the 5th
column of the current row my cursor is on to the next available blank row in
the same worksheet?

Thank you,

Sarah
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      12th Mar 2007
Dim rng as Range
set rng = cells(activecell.row,1).Range("A1:C1,E1")
rng.copy Cells(rows.count,1).End(xlup)(2)

that will put the copies in column A. If you want to keep them in the
same columns

Dim lastrow as Long
lastrow = cells(rows.count,1).End(xlup)(2).row
cells(Activecell.Row,1).Resize(1,3).copy cells(lastrow,1)
cells(activecell.row,5).copy cells(lastrow,5)

--
Regards,
Tom Ogilvy


"Sarah" wrote:

> Does anyone know how I can programatically copy the 1st 3 columns and the 5th
> column of the current row my cursor is on to the next available blank row in
> the same worksheet?
>
> Thank you,
>
> Sarah

 
Reply With Quote
 
=?Utf-8?B?U2FyYWg=?=
Guest
Posts: n/a
 
      12th Mar 2007
Thanks Tom... you're a genius!

Sarah

"Tom Ogilvy" wrote:

> Dim rng as Range
> set rng = cells(activecell.row,1).Range("A1:C1,E1")
> rng.copy Cells(rows.count,1).End(xlup)(2)
>
> that will put the copies in column A. If you want to keep them in the
> same columns
>
> Dim lastrow as Long
> lastrow = cells(rows.count,1).End(xlup)(2).row
> cells(Activecell.Row,1).Resize(1,3).copy cells(lastrow,1)
> cells(activecell.row,5).copy cells(lastrow,5)
>
> --
> Regards,
> Tom Ogilvy
>
>
> "Sarah" wrote:
>
> > Does anyone know how I can programatically copy the 1st 3 columns and the 5th
> > column of the current row my cursor is on to the next available blank row in
> > the same worksheet?
> >
> > Thank you,
> >
> > Sarah

 
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
Blank Copy =?Utf-8?B?SWRvaWE=?= Microsoft Outlook Discussion 1 5th Sep 2007 10:53 AM
Need macro to check if cell is not blank & previous cell is blank, copy information from row above & paste JenIT Microsoft Excel Programming 4 12th Apr 2007 08:56 PM
Copy to first Blank cell in Colum C Non blank cells still exist be =?Utf-8?B?VWxyaWsgbG92ZXMgaG9yc2Vz?= Microsoft Excel Programming 2 8th Oct 2006 07:35 PM
COPY A CONCATENATE CELL TO BLANK CELL PUTTING IN THE NEXT BLANK C. =?Utf-8?B?UVVFU1Q0MTA2Nw==?= Microsoft Excel Misc 1 15th Jan 2005 09:29 PM
Copy Until Blank Alec Microsoft Excel Programming 5 20th Oct 2003 03:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:22 AM.