LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Copy user selected range from all open workbooks

I'm trying to write a macro which will prompt the user to select a
range then copy that same range from all open workbooks, (it will
always be worksheet 1). At the moment i have this code:

Dim MyRange As Range
Set MyRange = Application.InputBox(Prompt:="Select any range",
Title:="Demo", Type:=8)
MyRange.Select
MsgBox MyRange

For a = 2 To (Workbooks.Count - 1)
Workbooks(a).Activate
Range("A4:B4").Select
Selection.Copy
Workbooks(Summary).Activate
Range("A65536").End(xlUp).Select
ActiveCell.Offset(2, 0).Select
Selection.PasteSpecial
Workbooks(a).Activate
Workbooks(a).Worksheets(1).Range(MyRange).Select
Selection.Copy
Workbooks(Summary).Activate
Range("A65536").End(xlUp).Select
ActiveCell.Offset(2, 0).Select
Selection.PasteSpecial

The first part works which is to copy the date of the workbook (Cells
A4:B4) but the next part does not work, i'm guessing the whole range
information is "saved" to the MyRange variable.

any ideas

Richard
 
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
How to tell a user no range has been selected. StargateFan Excel Programming 3 August 4th 09 10:42 PM
How to: User selected range? Phil Smith Excel Programming 7 December 19th 08 08:41 PM
Copy and paste selected columns between Excel workbooks Orimslala Excel Programming 4 April 4th 08 10:21 AM
Macro To Open a User selected File Chris Excel Worksheet Functions 2 September 6th 07 08:58 PM
Copy/ move selected data from workbooks to seperate worksheets or workbooks Positive Excel Worksheet Functions 1 August 30th 07 04:54 PM


All times are GMT +1. The time now is 07:31 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"