title: How to write in a cell based on another cell
body: <p>I'm trying to check if a cell in one sheet has a certain value, and if that's the case write a text string in another cell in another sheet.</p>
  <p>Afterwards I would like to call the same sub in some range in the first sheet and apply it to the corresponding range in the other sheet. The ranges don’t have them same location, only the same size.</p>
  <p>Here is an example:<br />
  <a href="https://i.stack.imgur.com/hutKS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hutKS.png" alt="enter image description here" /></a></p>
  <p>The first binary matrix is in the first sheet. (The location could as an example be in A1:B2).<br />
  The second matrix is made based on the first matrix (The location could as an example be in A1:B2).</p>
  <p>This is my idea so far (notice, it isn't working yet)</p>
  <pre><code>Sub Convert(SomeCell, AnotherCell)
      If Worksheets(&quot;Sheet1&quot;).Range(SomeCell).Value &gt; 0 Then
          Worksheets(&quot;Sheet2&quot;).Range(AnotherCell).Value = &quot;String&quot;
      End If
  End Sub
  </code></pre>
  <p><strong>EDIT</strong></p>
  <p>I'm searching for the corresponding VBA code for this IF statement formula</p>
  <pre><code>= IF(Sheet1!A1&gt;0;&quot;String&quot;;&quot;&quot;)
  </code></pre>
  <p>Which then can be dragged in some range.</p>