I am having problems with the code listed below. The syntax is fine, but it returns a value of #N/A. The code copies a value from a second sheet and pastes it into the current sheet.
The cell being copied derives its value from a VLOOKUP function on a different sheet. I think this may be creating the problem.
Is there a way to copy a cell's numeric value only and not the formula? Or maybe paste the value only (like the Paste Special - Values Only menu item)?
---------------------------------------------
With Worksheets("Daily Calcs")
For i = 2 To 360
If Worksheets("Positions").Cells(i, 20).Value = "RED LINE" Then
Set rng6 = .Range("A3").End(xlDown).Offset(0, 41)
rng6.Copy
ActiveSheet.Paste Destination:=Worksheets("Positions").Range("W2")
End If
Next i
End With
Thanks,
Will
The cell being copied derives its value from a VLOOKUP function on a different sheet. I think this may be creating the problem.
Is there a way to copy a cell's numeric value only and not the formula? Or maybe paste the value only (like the Paste Special - Values Only menu item)?
---------------------------------------------
With Worksheets("Daily Calcs")
For i = 2 To 360
If Worksheets("Positions").Cells(i, 20).Value = "RED LINE" Then
Set rng6 = .Range("A3").End(xlDown).Offset(0, 41)
rng6.Copy
ActiveSheet.Paste Destination:=Worksheets("Positions").Range("W2")
End If
Next i
End With
Thanks,
Will