I am getting an error 'Object Required' on this line 'Set copyRange = Union(copyRange,…
Jump to turn (11)
- 1I am getting an error 'Object Required' on this line 'Set copyRange = Union(copy
- 2error object required on the modified line
- 3it copied all the values in H and added it to the very first value of J. It did
- 4If copyRange Is Nothing Then Set copyRange = wscf.Range("J" & i) End If If wscf.
- 5With your code, this is what the output is: Shower Head descale05/09/202305/09/2
- 6My applogies, I did not mean to include the output address in my request. Here i
- 7With your code, this is what the output is: Shower Head descale05/09/202305/09/2
- 8the dates are not being concantenated with the other J values. They are all dupl
- 9No it is still doing the same thing. It is not cancateating the values correctly
- 10Problem has not been solved
- 11It is still not concatenating the values correctly
- User
I am getting an error 'Object Required' on this line 'Set copyRange = Union(copyRange, wscf.Range("J" & i) & wscf.Cells(i, "H"))' in this code below. For i = 5 To lastRow If wscf.Cells(i, "I") = "" Then If copyRange Is Nothing Then Set copyRange = wscf.Range("J" & i) If wscf.Cells(i, "H").Value <> "" Then copyRange.Value = wscf.Range("J" & i) & wscf.Cells(i, "H") End If Else Set copyRange = Union(copyRange, wscf.Range("J" & i) & wscf.Cells(i, "H")) End If End If Next i
- Assistant
The error "Object Required" occurs because you are trying to concatenate two range objects
wscf.Range("J" & i)andwscf.Cells(i, "H")using the&operator.The
&operator is used for concatenating strings, but in this case, you are trying to concatenate two range objects. To fix the error, you need to concatenate the values of the two range objects instead.