Hi there. I hope someone can help me figure this out because it's driving me crazy! I have been running this code for a while on a report and it has always worked until I just got this message: Run-time error '1004': Application-defined or object-defined error. After troubleshooting, I think it's because I have 9100 characters in the cell I'm trying to copy. I am looking for one of 2 solutions.
1. Increase the character limit that can be copied if 2 cells don't match
2. Flag the cells that won't copy because of this error with red highlighting and maybe pop up a box at the end informing that some data didn't copy - so at least the user will know which cells failed.
1. Increase the character limit that can be copied if 2 cells don't match
2. Flag the cells that won't copy because of this error with red highlighting and maybe pop up a box at the end informing that some data didn't copy - so at least the user will know which cells failed.
VBA Code:
Sub CNew()
Dim rngSelection As Range
Dim rngRow As Range
Dim cell As Range
Set rngSelection = Range("Tracker")
On Error Resume Next
For Each rngRow In rngSelection.Rows
If rngRow.Cells(1, 1) <> rngRow.Cells(1, 32) Then
rngRow.Cells(1, 1) = rngRow.Cells(1, 32)
End If
Next
End Sub
Last edited by a moderator: