Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Macro: Copy data to another sheet

Hi,

I have a rather simple question, I think.

I have a matrix of numbers (M38:O49) on sheet1. I need to have a macro
that copies these numbers from sheet1 to sheet2.

On sheet2 the numbers should not just be copied into a new matrix
(AB3:AD12), but added to the numbers already located in the sheet2 matrix.


So if my matrix on sheet1 consists of only 1's and the matrix on sheet2
consists of 4's, then the matrix on sheet2 should read only 5's after
applying the macro. Now filling sheet1 with only 4's should then produce
a matrix on sheet2 with only 9's after applying the macro once more, etc.


How can I do this (is has to be a macro!)?

Anders
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default Macro: Copy data to another sheet

Hi Anders

M38:O49 = 12 rows
AB3:AD12=10 rows only

This will paste the original range into AB3:AD14

Sub AddMatrix()
Sheets("Sheet1").Range("M38:O49").Copy
Sheets("Sheet2").Range("AB3").PasteSpecial Operation:=xlAdd
End Sub

Regards,
Per

"Anders" skrev i meddelelsen
...
Hi,

I have a rather simple question, I think.

I have a matrix of numbers (M38:O49) on sheet1. I need to have a macro
that copies these numbers from sheet1 to sheet2.

On sheet2 the numbers should not just be copied into a new matrix
(AB3:AD12), but added to the numbers already located in the sheet2 matrix.


So if my matrix on sheet1 consists of only 1's and the matrix on sheet2
consists of 4's, then the matrix on sheet2 should read only 5's after
applying the macro. Now filling sheet1 with only 4's should then produce a
matrix on sheet2 with only 9's after applying the macro once more, etc.


How can I do this (is has to be a macro!)?

Anders


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Macro: Copy data to another sheet

Per Jessen skrev:
Hi Anders

M38:O49 = 12 rows
AB3:AD12=10 rows only


Sorry, my mistake. Wrote the wrong numbers :-)

Sub AddMatrix()
Sheets("Sheet1").Range("M38:O49").Copy
Sheets("Sheet2").Range("AB3").PasteSpecial Operation:=xlAdd
End Sub


Works like a charm!

Thank you.

Anders
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
1 Create a macro to Copy & paste certain data to another sheet Lin1981 Excel Discussion (Misc queries) 1 November 6th 08 11:56 PM
Macro to copy a sheet and name it OdAwG Excel Discussion (Misc queries) 7 April 1st 07 10:22 PM
Macro to copy data from One sheet to another Jurassien Excel Discussion (Misc queries) 1 January 22nd 07 10:52 PM
Macro: Insert, copy and past data from sheet Metaldream7 Excel Discussion (Misc queries) 0 November 8th 06 09:31 PM
how to copy a cell with formula from sheet 1 (data is all vertical) into sheet 2 parag Excel Worksheet Functions 3 June 15th 06 10:29 PM


All times are GMT +1. The time now is 06:54 PM.

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"