Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Copy / Paste Not working with Target.value

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Copy / Paste Not working with Target.value

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?


"Schwimms" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Copy / Paste Not working with Target.value

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.

"JLGWhiz" wrote:

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?


"Schwimms" wrote in message
...
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



.

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 paste only working once Danny Excel Discussion (Misc queries) 2 February 17th 09 09:38 AM
copy/paste not working chicago1 Excel Worksheet Functions 3 March 5th 08 05:20 PM
Copy and Paste Not Working dstromain Excel Discussion (Misc queries) 1 October 14th 05 01:39 PM
copy paste is not working Becky1810 Excel Discussion (Misc queries) 1 July 16th 05 02:12 PM
Sub to copy a target sheet from slaves from and paste/overwrite into master Max Excel Programming 19 June 14th 05 02:22 AM


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