Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy paste only working once | Excel Discussion (Misc queries) | |||
copy/paste not working | Excel Worksheet Functions | |||
Copy and Paste Not Working | Excel Discussion (Misc queries) | |||
copy paste is not working | Excel Discussion (Misc queries) | |||
Sub to copy a target sheet from slaves from and paste/overwrite into master | Excel Programming |