Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Offset,Match,Copy, Paste Special - A Complicated Task - Help Pleas | Excel Programming | |||
Find, Copy offset to offset on other sheet, Run-time 1004. | Excel Programming | |||
Why Copy/Paste fails using Offset & Resize of myRange? | Excel Discussion (Misc queries) | |||
copy and paste with offset | Excel Discussion (Misc queries) | |||
Copy & Paste+Offset | Excel Programming |