Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
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
Actively select cells/ranges/sheets and Paste Link pl_hlp Excel Programming 0 June 6th 10 03:43 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
Copy paste ranges from multiple sheets Woody1313 Excel Programming 2 January 30th 06 03:37 PM
in charting, how do i select data ranges from multiple sheets, sa. michael Charts and Charting in Excel 1 March 6th 05 03:01 PM
select ranges of cells relative to location and then paste Buffyslay Excel Programming 3 June 22nd 04 05:00 PM


All times are GMT +1. The time now is 05:32 AM.

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"