title: How can I change color of text in a cell of MS Excel?
body: <p>I am using <code>Microsoft.Office.Interop.Excel</code> library.</p>
  
  <p>I have a cell with values "Green Red". What I want is pretty simple. I want to insert "Green" text to be green and "Red" to be red, like that:</p>
  
  <p><a href="https://i.stack.imgur.com/g9fF5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g9fF5.png" alt="enter image description here"></a></p>
  
  <p>I am using this code to insert data in cell:</p>
  
  <pre><code>Excel.Application excelApp = new Excel.Application();
  excelApp.Workbooks.Add();
  // single worksheet
  Excel._Worksheet workSheet = excelApp.ActiveSheet;
  
  for (int startIndex = 0; startIndex &lt; 10; startIndex++)
  {
      workSheet.Cells[1, (startIndex + 1)] ="Green" + " Red";
  }
  </code></pre>
  
  <p>How to do it?</p>
  
  <p>I've <a href="https://stackoverflow.com/questions/2452417/cell-color-changing-in-excel-using-c-sharp">tried this approach</a>, but I do not know what <code>[RangeObject]</code> is:</p>
  
  <p><code>[RangeObject].Font.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red);</code></p>