title: Excel VBA Write formula to a cell, refering to a number dependent on I and a sheet also dependent on I
body: <p>Could someone give me some pointers on how to write this formula right?</p>
  
  <pre><code>Sub WriteFormulaTextAndNumbersDependentOnI()
  Dim xNumber As Integer
  xNumber = InputBox ("Choose I")
      For I = 1 To xNumber
      Worksheets("Sheet1").Cells(1, 1 + I).Formula = "= &amp; 2,10 + 0,01 * (I - 1)'" &amp; Sheets(I + 1).Name &amp; "'!B12"
      Next I
  End Sub
  </code></pre>
  
  <p>The point here is to write a name in different cells, with a calculated number (2.10 + 0.01*(I - 1)) and text from another sheet:</p>
  
  <p>Lets say we have in Sheet2:
  B12 = Hello World</p>
  
  <p>Lets say we have in Sheet3:
  B12 = You are cool! </p>
  
  <p>We should then get in Sheet1:
  I = 1 would give a value/text in cell B2, with the value/text: "2.10+0.01*(1-1) B12" = "2.10 Hello World"
  I = 2 would give a value/text in cell C2, with the value/text: "2.10+0.01*(2-1) B12" = "2.11 You are cool!"
  An so on.</p>
  
  <p>Any suggestions?</p>
  
  <p>Appreciate any suggestions</p>
  
  <p>//GingerBoy</p>