I have VBA code in Excel. I have it looping a column (E2:E100). I want to just copy a cell (the same reference) from one worksheet to another.
Sub et()
Dim c As Range
Dim a As Range
Worksheets("CSV2").Select
'//loop it
For Each c In Range(Range("E2"), Range("E2").End(xlDown))
Set a = Worksheets("CSV").c '// The problem is here. I want the same range selection [c] as worksheet (CSV2) to the worksheet ("CSV") for the range selection [a]. I want to copy directly from [a] to [c]. I want to keep it in this format. Just help with the line here. Thanks.
If c.Value > 0 & c.Value < 3 Then
Sheets("CSV").Select
a.Copy'// here I have it to copy the "CSV" sheet
Sheets("CSV2").Select
c.PasteSpecial Paste:=xlPasteValues'// here I want to paste it to the "CSV2" sheet
End If
Next
Worksheets("RETURN").Select
End Sub