Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Copy Selection to new sheet

Hi

How can I copy Multiple Selection selected by user to copy
to a new sheet using VBA. Excel 2002, win 2k
Please advise

Thanks a lot
James
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Copy Selection to new sheet

Hi James,

You can't copy multiple selections in one go, so try something like

For Each area In Range("A1:A6,B1:B3,G2:J4,C16:D16")
area.Copy Destination:=Worksheets("Sheet1").Range(area.Addre ss)
Next area

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"James" wrote in message
...
Hi

How can I copy Multiple Selection selected by user to copy
to a new sheet using VBA. Excel 2002, win 2k
Please advise

Thanks a lot
James



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Copy Selection to new sheet

Try this in a macro:

Sub CopyUserSelectedCells()
Dim mySelection as Range
Set mySelection = Selection 'Assigns the current user selection,
'even if it's multiple non-contiguous cells
For Each C In mySelection
'copy each cell here to wherever you want
Worksheets("Name of new sheet").Range("Cell to copy to") = C
Next
End Sub


TH

On 4/21/04 16:06, in article , "James"
wrote:

Hi

How can I copy Multiple Selection selected by user to copy
to a new sheet using VBA. Excel 2002, win 2k
Please advise

Thanks a lot
James


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Copy Selection to new sheet

I think Bob meant this:

Dim area As Range
For Each area In Range("A1:A6,B1:B3,G2:J4,C16:D16").Areas
area.Copy Destination:=Worksheets("Sheet1").Range(area.Addre ss)
Next area

Without the .areas, it'll do it cell by cell (which will work).

but judging by the variable name....

Bob Phillips wrote:

Hi James,

You can't copy multiple selections in one go, so try something like

For Each area In Range("A1:A6,B1:B3,G2:J4,C16:D16")
area.Copy Destination:=Worksheets("Sheet1").Range(area.Addre ss)
Next area

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"James" wrote in message
...
Hi

How can I copy Multiple Selection selected by user to copy
to a new sheet using VBA. Excel 2002, win 2k
Please advise

Thanks a lot
James


--

Dave Peterson

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
Selection copy and insert to other sheet (Macro) VLOOKUP fORMULA Excel Discussion (Misc queries) 8 March 27th 10 02:48 PM
Selection copy and insert to other sheet VLOOKUP fORMULA Excel Discussion (Misc queries) 1 March 23rd 10 05:29 PM
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
Copy Selection jackle Excel Discussion (Misc queries) 3 March 7th 06 08:11 PM
Selection from list on main sheet from suplemental sheet in same w Kelly New Users to Excel 1 August 12th 05 04:37 PM


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