title: Excel VBA - select, get and set data in Table
body: <p>I've got a worksheet with a lot of tables in them and I'm just starting to use tables because they seem pretty handy. But I've never manipulated content in an Excel table before. And these tables are basically lists of columns with Firstname and Lastname. Based on the values on these columns, I want to generate a username. But I'm trying to write a generic Sub that takes arguments, such as worksheet and name of the table. </p>
  
  <p>Previously I've done this when the data has not been in a table:</p>
  
  <pre><code>Cells(2, 2).Select
  
  Do
      strFirstName = ActiveCell.Value
      strLastName = ActiveCell.Offset(0, 2).Value
  
      strFirstName = Left(strFirstName, 1)
  
      strUserName = strFirstName &amp; strLastName
      strUserName = LCase(strUserName)
  
      ActiveCell.Offset(0, 5).Value = strUserName
      ActiveCell.Offset(1, 0).Select
  Loop Until IsEmpty(ActiveCell)
  </code></pre>
  
  <p>And now I'm trying to do the exact same thing, only with data from a Table. Any ideas? I've added a watch for "ActiveSheet" to see if I can find the tables, and they seem to be in <code>ActiveSheet.ListObjects</code>, but I couldn't see any <code>.Select</code> option there. Perhaps I don't need to select the Table in order to manipulate it's content?</p>