In my worksheet some cells values are based on other cells
Info worksheet
A1: 5
B1: =A1
Design worksheet
A1:
Is there a way to copy and read the value in B1? I’m trying to use the value in a for loop, with no luck.
Sheets("Info").Select
For i = 1 to 5
If Range("B" & i).Value <> 0 Then
Range("B" & i).Copy Destination:=Sheets("Design").Range("A" & x)
'Sheets("Design").Range("A" & x).Value = Sheets("Offerte").Range("B" & i).Value
x = x + 1
End If
Next i
Your example doesn’t seem to match the code well. The line
means that nothing will be copied in your example. It’s looking for a cell with 1 in it. Why do you need that
Ifstatement at all?EDIT I am guessing you’re just checking that there’s something in the cell to copy? I would probably do it this way:
Also – did you miss out setting
x=1?