Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Copy and paste code

I can't seem to get this code to work. I am trying to set up a spreadsheet
that copys a range from one sheet and adds to the values on an identical
sheet. The problem is some of the cells are merged and my code unmerges them,
despite that when I do it manually, it works. Here is my code:

Sheets("Entry").Activate
Range("B5:Q13").Copy
Sheets("Total").Activate
Range("B5:Q13").PasteSpecial Paste:=xlPasteAll, Operation:=xlAdd,
SkipBlanks:= _
False, Transpose:=False

Sheets("Entry").Activate
Range("T5:AG13").Copy
Sheets("Total").Activate
Range("T5:AG13").PasteSpecial Paste:=xlPasteAll, Operation:=xlAdd,
SkipBlanks:= _
False, Transpose:=False


Basically I am tallying the numbers that are entered in the first sheet.
Please help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Copy and paste code

Sub Macro5() 'recorded
'
' Macro5 Macro
' Macro recorded 10/12/2006 by Don Guillett
'

'
Range("A1:E9").Select
Selection.Copy
Sheets("Sheet8").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteAllExceptBorders,
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("B13").Select
End Sub

cleaned up
Sub Macro5a()
Sheets("sheet7").Range("A1:E9").Copy
Sheets("Sheet8").Range("A1").PasteSpecial _
Paste:=xlPasteAllExceptBorders
End Sub

--
Don Guillett
SalesAid Software

"Rayo K" wrote in message
...
I can't seem to get this code to work. I am trying to set up a spreadsheet
that copys a range from one sheet and adds to the values on an identical
sheet. The problem is some of the cells are merged and my code unmerges
them,
despite that when I do it manually, it works. Here is my code:

Sheets("Entry").Activate
Range("B5:Q13").Copy
Sheets("Total").Activate
Range("B5:Q13").PasteSpecial Paste:=xlPasteAll, Operation:=xlAdd,
SkipBlanks:= _
False, Transpose:=False

Sheets("Entry").Activate
Range("T5:AG13").Copy
Sheets("Total").Activate
Range("T5:AG13").PasteSpecial Paste:=xlPasteAll, Operation:=xlAdd,
SkipBlanks:= _
False, Transpose:=False


Basically I am tallying the numbers that are entered in the first sheet.
Please help.



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
copy and paste using vb code ASU Excel Discussion (Misc queries) 1 September 10th 06 01:41 AM
copy and paste formula using vb code ASU Excel Discussion (Misc queries) 4 September 7th 06 08:56 PM
Got the Copy/Cut Code But what is the Paste Code Corey Excel Programming 7 July 7th 06 02:23 PM
Help-Copy&Paste code Bourbon[_30_] Excel Programming 2 January 29th 04 02:47 PM
Need Help with Code - Copy & Paste JStone0218 Excel Programming 10 October 11th 03 04:09 PM


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