I have below vba code Sub Macro1()
Dim FLrange As Range
Set FLrange = Range("C3:E3")
For Each cell In FLrange
If cell.Value = 0 Then cell.FormulaR1C1 = "=SUMIFS(raw!C4,raw!C1,R[0]C1,raw!C3,R2C[0])"
Next cell
End Sub
Now, before executing the formula in above code, i would like to add another function on this. I need to copy the current cell value to another sheet on exactly same cell. ie, value from sheet1 cell C3
has to be pasted sheet2 cell C3
I have tried with
Sub Macro1()
Dim FLrange As Range
Set FLrange = Range("C3:E3")
For Each cell In FLrange
Selection.Copy
Sheets("sheet2").Paste
If cell.Value = 0 Then cell.FormulaR1C1 = "=SUMIFS(raw!C4,raw!C1,R[0]C1,raw!C3,R2C[0])"
Next cell
End Sub
But this one not pasting the value corresponding cell in sheet2, but see it is pasting formula to random cell.
How can I paste the value from each cell in range in current sheet (sheet1), to corresponding cell in another sheet shet2