#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Paste Link

I have a workbook with multiple sheets in it, and then a copy of the multiple
sheets, ie: a1, a2, a3, a4, and b1, b2, b3, b4. b1 is identical to a1 but in
a different language (all columns/rows match exactly). I would like to write
a macro that allows me to select particular cells from a1, then pastes and
links them into their equivalent in b2. Basically, just a shorter way then
selecting a A:1 on a1 copying it, switching to b1, clicking on A:1 and
pasting special link.

Any help would be appreciated, thanks,

Lance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Paste Link

Hi Lance,

How about Double Cick the cell to copy and past the link. You could use the
following code. Not sure how competent you are with macros so to use the
macro, simply right click on the sheet tab name (of the sheet where you are
copying from) and select View Code to open the VBA editor for the selected
sheet.

Copy the code into the VBA editor and close the editor by clicking on the X
top right of screen.

You will need to edit the sheet names if you have different names to Sheet1
and Sheet2.

You can then Double Click the cell to copy and the link will be placed on
the other sheet.

Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Range, Cancel As Boolean)

Dim sht1 As Worksheet
Dim sht2 As Worksheet
Dim strAddress

Set sht1 = Sheets("Sheet1")
Set sht2 = Sheets("Sheet2")

strAddress = Target.Address
Selection.Copy
sht2.Select
ActiveSheet.Range(strAddress).Select
ActiveSheet.Paste Link:=True
sht1.Select

'Cancel the double click so the cell
'does not remain in Edit mode
Cancel = True
Application.CutCopyMode = False

End Sub


--
Regards,

OssieMac


"Lance" wrote:

I have a workbook with multiple sheets in it, and then a copy of the multiple
sheets, ie: a1, a2, a3, a4, and b1, b2, b3, b4. b1 is identical to a1 but in
a different language (all columns/rows match exactly). I would like to write
a macro that allows me to select particular cells from a1, then pastes and
links them into their equivalent in b2. Basically, just a shorter way then
selecting a A:1 on a1 copying it, switching to b1, clicking on A:1 and
pasting special link.

Any help would be appreciated, thanks,

Lance

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 08:11 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"