title: Excel VBA Macros Format rows based on Values
body: <p>Hey guys I have a table that I want to format with vba as it is a lot of values and it takes way too long formatting one by one.</p>
  
  <p>example</p>
  
  <p>Client ID ---------- Employee ---------- Hours</p>
  
  <p>0001 ------------------Josh  -------------5</p>
  
  <p>0001 ------------------Carl  -------------5</p>
  
  <p>0001 ------------------Joe  --------------5</p>
  
  <p>0005 ------------------Ken  --------------5</p>
  
  <p>0005 ------------------Jeff --------------5</p>
  
  <p>0008 ------------------Joe  --------------5</p>
  
  <p>0008 ------------------Josh  -------------5</p>
  
  <p>0009 ------------------Carl  -------------5</p>
  
  <p>0011 ------------------Joe  --------------5</p>
  
  <p>0011 ------------------Carl --------------5</p>
  
  <p>I want to apply a border underneath the last of the same ClientID to separate them from the rest of the ClientID's so that it is easier to read when looking at information so the output should be something like this:</p>
  
  <p>Client ID ---------- Employee ---------- Hours</p>
  
  <p>0001 ------------------Josh  -------------5</p>
  
  <p>0001 ------------------Carl  -------------5</p>
  
  <p>0001 ------------------Joe  --------------5</p>
  
  <hr>
  
  <p>0005 ------------------Ken  --------------5</p>
  
  <p>0005 ------------------Jeff --------------5</p>
  
  <hr>
  
  <p>0008 ------------------Joe  --------------5</p>
  
  <p>0008 ------------------Josh  -------------5</p>
  
  <hr>
  
  <p>0009 ------------------Carl  -------------5</p>
  
  <hr>
  
  <p>0011 ------------------Joe  --------------5</p>
  
  <p>0011 ------------------Carl --------------5</p>
  
  <hr>
  
  <p>I am guessing I need some sort of loop that goes down ClientID Column and checks each ClientID..as soon as a new ClientID shows up then Add a border to the top of that Row or Bottom of previous one. I know I should have some code, if anyone can point me in the right direction or give me some  clues I can continue to write something up.</p>
  
  <p><img src="https://i.stack.imgur.com/mVjuu.png" alt="screenshot"></p>