Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Microsoft Support > Microsoft Office support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Microsoft Office support MS Office support forum

Reply
 
LinkBack Thread Tools
Old 07-28-2009, 08:44 AM   #1 (permalink)
Registered User
 
Join Date: Jul 2009
Posts: 1
OS: XP


Data copy from 1 sheet to another

I'm working on a score sheet to allow supervisors to monitor and score calls for quality assurance in a contact center.

Currently, I have a sheet in my workbook called "observation" which is the sheet supervisors will use to grade the call.

At the end of the sheet I have a button designed to copy the data from the observation sheet to "sheet1" which is where we will store the scores for reporting.

It all works well, except that several of my cells are giving Div/0 errors after the copy.

It looks like the script is copying the formula instead of the values.

Here is my current code:
Code:
Private Sub CommandButton1_Click()

Dim ShA As Worksheet
Dim ShB As Worksheet
Dim TargetRange1 As Range
Dim TargetRange2 As Range
Dim TargetRange3 As Range
Dim TargetRange4 As Range
Dim TargetRange5 As Range
Dim TargetRange6 As Range
Dim TargetRange7 As Range
Dim TargetRange8 As Range
Dim TargetRange9 As Range
Dim TargetRange10 As Range
Dim TargetRange11 As Range
Dim TargetRange12 As Range
Dim TargetRange13 As Range
Dim TargetRange14 As Range
Dim TargetRange15 As Range
Dim TargetRange16 As Range
Dim TargetRange17 As Range
Dim TargetRange18 As Range
Dim TargetRange19 As Range
Dim TargetRange20 As Range
Dim TargetRange21 As Range
Dim TargetRange22 As Range
Dim TargetRange23 As Range
Dim CopyToCell As Range


Set ShA = Worksheets("Observation")
Set ShB = Worksheets("Sheet1")
With ShA
    Set TargetRange1 = .Range("C5:C11,C19:C25")
    Set TargetRange2 = .Range("D18:F18")
    Set TargetRange5 = .Range("C27:C34")
    Set TargetRange6 = .Range("D26:F26")
    Set TargetRange9 = .Range("C36:C44")
    Set TargetRange10 = .Range("D35:F35")
    Set TargetRange13 = .Range("C46:C49")
    Set TargetRange14 = .Range("D45:F45")
    Set TargetRange17 = .Range("C51:C52")
    Set TargetRange18 = .Range("D50:F50")
    Set TargetRange21 = .Range("C53, E53:F53")
End With


If ShB.Range("A2") = "" Then ' Headings in row 1
    Set CopyToCell = ShB.Range("A2")
Else
    Set CopyToCell = ShB.Range("A1").End(xlDown).Offset(1, 0)
End If


TargetRange1.Copy
CopyToCell.PasteSpecial xlPasteValues, , , Transpose:=True
TargetRange2.Copy Destination:=CopyToCell.Offset(0, 14)
TargetRange5.Copy
CopyToCell.Offset(0, 17).PasteSpecial xlPasteValues, , , Transpose:=True
TargetRange6.Copy Destination:=CopyToCell.Offset(0, 25)
TargetRange9.Copy
CopyToCell.Offset(0, 28).PasteSpecial xlPasteValues, , , Transpose:=True
TargetRange10.Copy CopyToCell.Offset(0, 37)
TargetRange13.Copy
CopyToCell.Offset(0, 40).PasteSpecial xlPasteValues, , , Transpose:=True
TargetRange14.Copy CopyToCell.Offset(0, 44)
TargetRange17.Copy
CopyToCell.Offset(0, 47).PasteSpecial xlPasteValues, , , Transpose:=True
TargetRange18.Copy CopyToCell.Offset(0, 49)
TargetRange21.Copy
CopyToCell.Offset(0, 52).PasteSpecial xlPasteValues
Application.CutCopyMode = False



End Sub
I thought that the PasteSpecial xlPasteValues would resolve this, but I seem to be missing something.

the cells in question are:
D18, E18, F18
D26, E26, F26
D35, E35, F35
D45, E45, F45
D50, E50, F50

Basically the fields that report overall scores from formulas.

Can someone point me in the right direction?

Thanks.
jaikin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Reply


Thread Tools

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 Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 01:44 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85