Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Actively select cells/ranges/sheets and Paste Link
Hello:
What I am trying to do is select the cells or range on a sheet that I am interested in, then paste link on a different sheet. All the selections should be variable (I mean not be hardcoded). Thanks, pl_hlp |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Actively select cells/ranges/sheets and Paste Link
Something like this:
Sub YetAnotherTry() Dim r1 As Range, r2 As Range Set r1 = Application.InputBox(prompt:="select copy area", Type:=8) ady1 = r1.Address Sheets("Sheet2").Select Set r2 = Application.InputBox(prompt:="select destination cell", Type:=8) ady2 = r2.Address Sheets("sheet1").Select Range(ady1).Select Selection.Copy Sheets("Sheet2").Select Range(ady2).Select ActiveSheet.Paste Link:=True End Sub -- Gary''s Student - gsnu201004 "pl_hlp" wrote: Hello: What I am trying to do is select the cells or range on a sheet that I am interested in, then paste link on a different sheet. All the selections should be variable (I mean not be hardcoded). Thanks, pl_hlp |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Actively select cells/ranges/sheets and Paste Link
Hi Gary's Student:
Thank you for your help. I played with the codes. The codes meet some of my objectives. I am wondering if we can make them smarter. The selection range is on a variable sheet (not hardcoded to "Sheet 1") and the destination is on another variable sheet (not hard coded to "Sheet 2"). Further, when we copy "Plaste Link", the sequence of destination cells is not the same as the origin cells. The destination cells will be as per a prefined sequence. Let me explain this a little bit. The origin cells are selected from 8 consecutive cells on a column. When we Paste Link, the destination cells will in 2 by 4 cells. Thanks, pl_hlp "Gary''s Student" wrote: Something like this: Sub YetAnotherTry() Dim r1 As Range, r2 As Range Set r1 = Application.InputBox(prompt:="select copy area", Type:=8) ady1 = r1.Address Sheets("Sheet2").Select Set r2 = Application.InputBox(prompt:="select destination cell", Type:=8) ady2 = r2.Address Sheets("sheet1").Select Range(ady1).Select Selection.Copy Sheets("Sheet2").Select Range(ady2).Select ActiveSheet.Paste Link:=True End Sub -- Gary''s Student - gsnu201004 "pl_hlp" wrote: Hello: What I am trying to do is select the cells or range on a sheet that I am interested in, then paste link on a different sheet. All the selections should be variable (I mean not be hardcoded). Thanks, pl_hlp |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Actively select cells/ranges/sheets and Paste Link | Excel Programming | |||
PASTE LINK option not available when I select PASTE SPECIAL to link an image in Excel to a Word document. | Links and Linking in Excel | |||
Copy paste ranges from multiple sheets | Excel Programming | |||
in charting, how do i select data ranges from multiple sheets, sa. | Charts and Charting in Excel | |||
select ranges of cells relative to location and then paste | Excel Programming |