Prev: Selection.Cut Destination:=Columns("B:B")
Next: Actively select cells/ranges/sheets and Paste Link
From: pl_hlp on 5 Jun 2010 22:43
From: Gary''s Student on 6 Jun 2010 10:28 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
From: pl_hlp on 6 Jun 2010 11:56 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
|
Pages: 1 Prev: Selection.Cut Destination:=Columns("B:B") Next: Actively select cells/ranges/sheets and Paste Link |