Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Insert Rows & Paste Link

I am writing code to copy a range of cells in Workbook A, then open Workbook
B and paste them as a link. Before they are pasted in Workbook B, however,
my code searches for the first available empty row to paste the link.
Farther below where the paste link is to occur, I have an existing row of
Totals that sums all the previous stuff I've pasted.

The problem I encounter is that once the first empty row is found, I want to
insert 5 rows first (so that my Totals row gets pushed down to make room),
then paste the link. However, after the code I wrote to insert the five rows
executes, the clipboard loses the copied cells. Is there a way to paste a
link and insert the rows I want without losing the contents of the clipboard?
Thanks for all your suggestions!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Insert Rows & Paste Link

Just change the order of things.

Find that row, insert the new rows, then copy the range and paste special links.

dim myRngToCopy as range
dim DestCell as range

set myrngtocopy = somerangeyouknowabout

'code to find the destination cell
set destcell = whateveryouneed here

application.goto destcell
myrngtocopy.copy
activesheet.paste link:=true




Steve C wrote:

I am writing code to copy a range of cells in Workbook A, then open Workbook
B and paste them as a link. Before they are pasted in Workbook B, however,
my code searches for the first available empty row to paste the link.
Farther below where the paste link is to occur, I have an existing row of
Totals that sums all the previous stuff I've pasted.

The problem I encounter is that once the first empty row is found, I want to
insert 5 rows first (so that my Totals row gets pushed down to make room),
then paste the link. However, after the code I wrote to insert the five rows
executes, the clipboard loses the copied cells. Is there a way to paste a
link and insert the rows I want without losing the contents of the clipboard?
Thanks for all your suggestions!


--

Dave Peterson
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
'paste special', 'paste link' formatting transfer jrebello Excel Discussion (Misc queries) 2 July 25th 07 08:46 AM
PASTE LINK option not available when I select PASTE SPECIAL to link an image in Excel to a Word document. tln Links and Linking in Excel 0 April 22nd 07 04:28 PM
Formatting not retained using paste all and paste link ABCMS Excel Worksheet Functions 1 March 9th 06 12:37 PM
Paste Link enters a 0 into the cell where I paste. How do I elemin UNR Excel Discussion (Misc queries) 4 March 28th 05 01:54 AM
Paste Link is greyed out during Paste Special Lawrence M. Seldin, CMC, CPC Excel Programming 0 May 10th 04 08:25 PM


All times are GMT +1. The time now is 04:08 PM.

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

About Us

"It's about Microsoft Excel"