title: Reading data in one cell and writing to another
body: <p>I have a Excel file and I want to read each value within a cell... i.e A cell in column B row 2 may contain ("1 - 10 - 11 - 15 - 17") or  ("1-10-11-15-17") with or without the spaces between the hyphen. I want to read each number and save each value as the number 1 in another column on the same row. For example my column B row 2 data is ("1 - 10 - 11 - 15 - 17") or  ("1-10-11-15-17") and I want to write a value of 1 on the same row 2 in columns C, L, M, Q, and S as the value of 1. How can I read the data from a cell and write in another cell using a Macro or VBA? </p>
  
  <p>Thanks in advance for your help,
  Rose</p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>This is just an ex of code</p>
  
  <pre><code>Sub Macro1() 
  RowCount = Worksheets("2013").UsedRange.Rows.Count 
  For i = 2 To RowCount cellvalue = Worksheets("2013").Cells(i, "B").Value 
      If InStr(cellvalue, "1") = 1 Or InStr(cellvalue, "1") &gt; 2 And InStr(cellvalue, "1") &lt; 22 Then 
          Worksheets("2013").Cells(i, "C") = Null 
      ElseIf InStr(cellvalue, "10") &lt;&gt; 0 Then Worksheets("2013").Cells(i, "L") = 1 
      ElseIf InStr(cellvalue, "11") &lt;&gt; 0 Then 
          Worksheets("2013").Cells(i, "M") = 1 
      ElseIf InStr(cellvalue, "12") &lt;&gt; 0 Then 
          Worksheets("2013").Cells(i, "N") = 1 
      Else Worksheets("2013").Cells(i, "C") = Null 
      End If
  </code></pre>