Copy / Paste Not working with Target.value

S

Schwimms

Hi All!

I have a spreadsheet which records data entered into a "Main" tab onto an
"Updates" tab. In the code behind for the "Main" tab I am grabbing the data
with:

Case 3
valueChanged = Target.Value

The valueChanged then shows up on the "Updates" tab, code included below. My
problem occurs when I copy and paste into multiple cells it doesn't recognize
a change in the cell value I'm pasting into. Any ideas how to correct this?

Here is an example code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim dbTable As String
Dim dbCol As String
Dim keyRecord As Variant
Dim valueChanged As Variant
Dim x As Integer
Dim strDup As String
If Target.Row > 2 And Cells(Target.Row, 70).Value <> "" And Sheets("Mobility
2010 Build List").Range("F1").Value = "YES" Then
Select Case Target.Column
Case 1
valueChanged = Target.Value
End Select

x = 3

Do Until Sheets("Updates").Cells(x, 1).Value = ""
If dbCol = Sheets("Updates").Cells(x, 3).Value And keyRecord =
Sheets("Updates").Cells(x, 2).Value Then
strDup = "Y"
GoTo Duplicate
End If
x = x + 1
Loop
strDup = ""
'Jump point for above do until loop to exit loop if duplicate entry detected.
Duplicate:

Sheets("Updates").Cells(x, 4).Value = valueChanged
If strDup = "Y" Then
Sheets("Updates").Cells(x, 5).Value = ""
End If
End If
End Sub
 
J

JLGWhiz

I do not see anything in the code that would prevent it from posting as long
as the case criteria is met. Have you stepped through the code to make sure
all variables are what you expect them to be, when you expect them to be?
 
S

Schwimms

It posts over to the other spreadsheet perfectly although it doesn't allow
pasted values to be posted over, except for the first line. For example, I
paste data into cells c3 through c10. The only data that is posted to the
other page is cell c3, the other cells c4 - c10 are not being transferred to
the "updates" page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top