title: Excel macro : loop and append
body: <p>I am a total newbie when it comes to VBA and excel though, not to programming in general. It seems that I am having quite a time trying to decipher VBA. </p>
  
  <p>What I want to do, is loop through an unknown number of rows in a column and then if it contains a specific acronym it will check the same row in a different column it will append one of two strings depending on the second cell's contents. This code doesn't seem to work but perhaps it will help elucidate what I'm getting at.</p>
  
  <pre><code>Sub AppendMacro()
  '
  'Append Macro
  'Keyboard Shortcut: Ctrl+l
  '
  Dim c As Range
  
  For Each c In Range("S:S")
  
      If c.Value = "USAA" Or c.Value = "U.S.A.A" Then
  
      ActiveCell.Offset(0, 2).Select
  
       If ActiveCell.Value = "AM" Then
  
         ActiveCell.Value = ActiveCell.Value &amp; "8-10"
  
         End If
  
      End If
  Next c
  
  End Sub 
  </code></pre>
  
  <p>One thing I know is that the value of the cell isn't exactly going to be USAA or U.S.A.A but will contain those sets of characters. Also, I'm sure I'm misunderstanding how ActiveCell works but if anything will set me straight it'll be you guys.</p>