Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Range select

My user will select a range of cells in Sheet1 then I need some code that will:

1. Activate Sheet2
2. Select the same range of cells in Sheet2 that the user selected in Sheet1

Thanks in advance
--
Gary's Student
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Range select

One way:

Application.GoTo Sheets("Sheet2").Range(Selection.Address)

In article ,
Gary''s Student wrote:

My user will select a range of cells in Sheet1 then I need some code that
will:

1. Activate Sheet2
2. Select the same range of cells in Sheet2 that the user selected in Sheet1

Thanks in advance

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Range select

Gary's Student,

Dim myRange As Range
Set myRange = Selection
Worksheets("Sheet2").Activate
Range(myRange.Address).Select

Or, to do it within a running macro:

Dim myRange As Range
'Other code here
Set myRange = Application.InputBox("Select Cells", , , , , , , 8)
Worksheets("Sheet2").Activate
Range(myRange.Address).Select


HTH,
Bernie
MS Excel MVP


"Gary''s Student" wrote in message
...
My user will select a range of cells in Sheet1 then I need some code that
will:

1. Activate Sheet2
2. Select the same range of cells in Sheet2 that the user selected in
Sheet1

Thanks in advance
--
Gary's Student



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Range select

Thank you both very much
--
Gary's Student


"Bernie Deitrick" wrote:

Gary's Student,

Dim myRange As Range
Set myRange = Selection
Worksheets("Sheet2").Activate
Range(myRange.Address).Select

Or, to do it within a running macro:

Dim myRange As Range
'Other code here
Set myRange = Application.InputBox("Select Cells", , , , , , , 8)
Worksheets("Sheet2").Activate
Range(myRange.Address).Select


HTH,
Bernie
MS Excel MVP


"Gary''s Student" wrote in message
...
My user will select a range of cells in Sheet1 then I need some code that
will:

1. Activate Sheet2
2. Select the same range of cells in Sheet2 that the user selected in
Sheet1

Thanks in advance
--
Gary's Student




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
Select used range [email protected] Excel Worksheet Functions 2 February 19th 09 03:46 AM
How can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
VBA Range select Craig[_2_] Excel Programming 4 April 28th 05 04:23 PM
Select Sheet then Select Range Gee[_2_] Excel Programming 3 May 27th 04 10:10 PM


All times are GMT +1. The time now is 09:08 AM.

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"