PC Review


Reply
Thread Tools Rate Thread

Copy and paste code

 
 
=?Utf-8?B?UmF5byBL?=
Guest
Posts: n/a
 
      12th Oct 2006
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 With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      12th Oct 2006
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
(E-Mail Removed)
"Rayo K" <(E-Mail Removed)> wrote in message
news:3A087DE1-E087-44DA-AB0D-(E-Mail Removed)...
>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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cut, Copy, Paste code John Microsoft Dot NET Framework Forms 10 18th Jan 2010 09:37 AM
Cut, Copy, Paste code John Microsoft VB .NET 9 19th May 2008 01:00 AM
Code for Copy/Paste PD Microsoft Access Form Coding 10 21st Feb 2008 01:40 PM
I keep getting this code <o:p> when I copy and paste. =?Utf-8?B?U2NhcnI=?= Microsoft Word Document Management 3 16th Feb 2007 07:18 PM
copy and paste using vb code =?Utf-8?B?QVNV?= Microsoft Excel Misc 1 10th Sep 2006 01:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:10 AM.