title: Inserting a column in the end in excel vba
body: <p>My dataset looks like this </p>
  
  <p><img src="https://i.stack.imgur.com/60ji9.jpg" alt="enter image description here"></p>
  
  <p>Category    dummy1  dummy2</p>
  
  <p>Aan<br>
  Abd<br>
  Bad<br>
  Boy<br>
  Abcd        </p>
  
  <p>I want to insert a column names "RESULT" in the end, with conditions
  if category starts with a then RESULT="PASS"
  if category starts with b then RESULT="FAIL"</p>
  
  <p>ie, my final output should be like this</p>
  
  <p><img src="https://i.stack.imgur.com/DdvS6.jpg" alt="enter image description here"></p>
  
  <p>How can I do this in excel-vba. Please help me. </p>
  
  <p>I am editing the existing spreadsheets.</p>
  
  <pre><code>Dim rngTemp As Range
  Set rngTemp = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
  
  For Each cel In Range(Cells(1, 1), rngTemp)
  If cel.Value = "I currently live in" Then
  cel.Value = "Current_Domicile"
  ElseIf cel.Value = "I am interested in purchasing" Then
  cel.Value = "Type_of_Property"
  ElseIf cel.Value = "I am interested in purchasing" Then
  cel.Value = "Wait_Time"
  ElseIf cel.Value = "The reason that I am not buying a house right away is because I am:" Then
  cel.Value = "Reason_for_Wait"
  End If
  Next Cel
  </code></pre>
  
  <p>I want to add a new column with the conditions above.</p>