Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Paste to Multiple Selections

Hi
I am trying to find a way to be able to paste to multiple
selections in a number of grouped sheets. In the example
below it only refers to 2 cell locations whereas there are
actually more.

Thanks in antisipations.

Mick

Sheets(Array
("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "S
ep", "Oct", "Nov", _
"Dec")).Select
Sheets("Jan").Activate

Worksheets("DataSheet").Range("G10,G11").Copy
ActiveSheet.Paste Destination:=Worksheets("Jan").Range
("A4:A5") 'Selection.Paste
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Paste to Multiple Selections

Mack,

You should group the sheets after the copy, and use the FillAcrossSheets
method:

Worksheets("DataSheet").Range("G10:G11").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A4:A5").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A4:A5"), xlFillWithContents


HTH,
Bernie
MS Excel MVP

"Mick" wrote in message
...
Hi
I am trying to find a way to be able to paste to multiple
selections in a number of grouped sheets. In the example
below it only refers to 2 cell locations whereas there are
actually more.

Thanks in antisipations.

Mick

Sheets(Array
("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "S
ep", "Oct", "Nov", _
"Dec")).Select
Sheets("Jan").Activate

Worksheets("DataSheet").Range("G10,G11").Copy
ActiveSheet.Paste Destination:=Worksheets("Jan").Range
("A4:A5") 'Selection.Paste
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Paste to Multiple Selections

Bernie

Thanks, unfortunately the ranges used in the example were in correct, in as
much as they are not adjacent i.e. G10:G11 should read G10,G14 and A4:A5
should read A4,A15. I can get the code to work if I past to adjacent cells
but not non adjacent cells - Hope that make sense

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Mack,

You should group the sheets after the copy, and use the FillAcrossSheets
method:

Worksheets("DataSheet").Range("G10:G11").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A4:A5").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A4:A5"), xlFillWithContents


HTH,
Bernie
MS Excel MVP

"Mick" wrote in message
...
Hi
I am trying to find a way to be able to paste to multiple
selections in a number of grouped sheets. In the example
below it only refers to 2 cell locations whereas there are
actually more.

Thanks in antisipations.

Mick

Sheets(Array
("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "S
ep", "Oct", "Nov", _
"Dec")).Select
Sheets("Jan").Activate

Worksheets("DataSheet").Range("G10,G11").Copy
ActiveSheet.Paste Destination:=Worksheets("Jan").Range
("A4:A5") 'Selection.Paste
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Paste to Multiple Selections

Mick,

Just do it twice:

Worksheets("DataSheet").Range("G10").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A4").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A4"), xlFillWithContents
Worksheets("DataSheet").Range("G14").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A15").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A15"), xlFillWithContents

HTH,
Bernie
MS Excel MVP

"Mick Southam" wrote in message
...
Bernie

Thanks, unfortunately the ranges used in the example were in correct, in

as
much as they are not adjacent i.e. G10:G11 should read G10,G14 and A4:A5
should read A4,A15. I can get the code to work if I past to adjacent

cells
but not non adjacent cells - Hope that make sense

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Mack,

You should group the sheets after the copy, and use the FillAcrossSheets
method:

Worksheets("DataSheet").Range("G10:G11").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A4:A5").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A4:A5"), xlFillWithContents


HTH,
Bernie
MS Excel MVP

"Mick" wrote in message
...
Hi
I am trying to find a way to be able to paste to multiple
selections in a number of grouped sheets. In the example
below it only refers to 2 cell locations whereas there are
actually more.

Thanks in antisipations.

Mick

Sheets(Array
("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "S
ep", "Oct", "Nov", _
"Dec")).Select
Sheets("Jan").Activate

Worksheets("DataSheet").Range("G10,G11").Copy
ActiveSheet.Paste Destination:=Worksheets("Jan").Range
("A4:A5") 'Selection.Paste
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Paste to Multiple Selections

Bernie

If say, there were 20 or more non adjacent cells in the reference you were
trying to paste to, how would you do it then?

Thanks

Mick

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Mick,

Just do it twice:

Worksheets("DataSheet").Range("G10").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A4").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A4"), xlFillWithContents
Worksheets("DataSheet").Range("G14").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A15").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A15"), xlFillWithContents

HTH,
Bernie
MS Excel MVP

"Mick Southam" wrote in message
...
Bernie

Thanks, unfortunately the ranges used in the example were in correct, in

as
much as they are not adjacent i.e. G10:G11 should read G10,G14 and A4:A5
should read A4,A15. I can get the code to work if I past to adjacent

cells
but not non adjacent cells - Hope that make sense

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Mack,

You should group the sheets after the copy, and use the

FillAcrossSheets
method:

Worksheets("DataSheet").Range("G10:G11").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A4:A5").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A4:A5"), xlFillWithContents


HTH,
Bernie
MS Excel MVP

"Mick" wrote in message
...
Hi
I am trying to find a way to be able to paste to multiple
selections in a number of grouped sheets. In the example
below it only refers to 2 cell locations whereas there are
actually more.

Thanks in antisipations.

Mick

Sheets(Array
("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "S
ep", "Oct", "Nov", _
"Dec")).Select
Sheets("Jan").Activate

Worksheets("DataSheet").Range("G10,G11").Copy
ActiveSheet.Paste Destination:=Worksheets("Jan").Range
("A4:A5") 'Selection.Paste
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Paste to Multiple Selections

Mick,

If there weren't a pattern to the cells, I would do something like

Dim i As Integer
Dim mySource As Range
Dim myTarget As Range

Set mySource = Worksheets("DataSheet").Range("G10,G14,G18, H5, K12")
Set myTarget = Worksheets("Jan").Range("A4,A15,C12,D16,E19")

For i = 1 to mySource.Cells.Count
mySource(i).Copy myTarget(i)
myTarget(i).Value = myTarget(i).Value
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Worksheets("Jan").Activate
ActiveWindow.SelectedSheets.FillAcrossSheets _
myTarget(i), xlFillWithContents
Next i

If there were a pattern to the cells, then I would use two indices.

HTH,
Bernie
MS Excel MVP


"Mick Southam" wrote in message
...
Bernie

If say, there were 20 or more non adjacent cells in the reference you were
trying to paste to, how would you do it then?

Thanks

Mick

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Mick,

Just do it twice:

Worksheets("DataSheet").Range("G10").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A4").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A4"), xlFillWithContents
Worksheets("DataSheet").Range("G14").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A15").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A15"), xlFillWithContents

HTH,
Bernie
MS Excel MVP

"Mick Southam" wrote in message
...
Bernie

Thanks, unfortunately the ranges used in the example were in correct,

in
as
much as they are not adjacent i.e. G10:G11 should read G10,G14 and

A4:A5
should read A4,A15. I can get the code to work if I past to adjacent

cells
but not non adjacent cells - Hope that make sense

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Mack,

You should group the sheets after the copy, and use the

FillAcrossSheets
method:

Worksheets("DataSheet").Range("G10:G11").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A4:A5").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A4:A5"), xlFillWithContents


HTH,
Bernie
MS Excel MVP

"Mick" wrote in message
...
Hi
I am trying to find a way to be able to paste to multiple
selections in a number of grouped sheets. In the example
below it only refers to 2 cell locations whereas there are
actually more.

Thanks in antisipations.

Mick

Sheets(Array
("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "S
ep", "Oct", "Nov", _
"Dec")).Select
Sheets("Jan").Activate

Worksheets("DataSheet").Range("G10,G11").Copy
ActiveSheet.Paste Destination:=Worksheets("Jan").Range
("A4:A5") 'Selection.Paste
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False











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
Multiple selections Confuddled User!!!!!!!!!!!!! Excel Discussion (Misc queries) 3 August 30th 07 08:56 PM
copy and paste with multiple selections in Microsoft Excel capnhud Excel Discussion (Misc queries) 10 September 6th 06 08:58 PM
copy and paste with multiple selections in Microsoft Excel capnhud Excel Discussion (Misc queries) 1 September 5th 06 01:13 PM
Vlookup for multiple selections Billing Goddess Excel Worksheet Functions 7 April 10th 06 05:40 PM
Copy and paste selections and formatting to new worksheet gavmer Excel Programming 1 February 5th 04 03:52 AM


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