Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default vba; copy row, paste at offset

I have a row copied to the clipboard, and I want to paste it into
sheetB at rowR, colC.

I can do the paste if I select the entire row, but that's now what I
want. Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default vba; copy row, paste at offset

If you copy an entire row, you have to paste an entire row. You can't put
more into less. If you want to paste into less space, you need to reduce the
amount you copy to the size (or smaller) of the space you want to paste into.

"md" wrote:

I have a row copied to the clipboard, and I want to paste it into
sheetB at rowR, colC.

I can do the paste if I select the entire row, but that's now what I
want. Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default vba; copy row, paste at offset

To copy only the data in a row you can use something like this:

lstCol = ActiveSheet.SpecialCells(xlCellTypeLastCell).Colum n
Range(Cells(ActiveCell.Row, 1), Cells(ActiveCell.Row, lstCol).Copy

If you are using a variable to identify the cursor location, then substitute
that for the ActiveCell. That will give you a range that is only as long as
the last cell with data in it. Then you can paste it in a range less than a
full row length.

"md" wrote:

I have a row copied to the clipboard, and I want to paste it into
sheetB at rowR, colC.

I can do the paste if I select the entire row, but that's now what I
want. Thank you.

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
Offset,Match,Copy, Paste Special - A Complicated Task - Help Pleas Mark Dullingham Excel Programming 2 March 8th 07 11:33 PM
Find, Copy offset to offset on other sheet, Run-time 1004. Finny[_3_] Excel Programming 10 December 7th 06 11:46 PM
Why Copy/Paste fails using Offset & Resize of myRange? [email protected] Excel Discussion (Misc queries) 3 November 21st 06 02:06 AM
copy and paste with offset kevcar40 Excel Discussion (Misc queries) 3 October 10th 05 03:20 PM
Copy & Paste+Offset Ronald Cayne Excel Programming 2 September 7th 04 07:35 AM


All times are GMT +1. The time now is 05:39 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"