title: Excel Vba Macro to Wrap, Center, Auto Size Columns and Rows
body: <p>I am trying to get this column to do a few things, but when it gets to wrap text and center it isn't doing it...it doesn't error but it doesn't wrap or center...any thoughts? ty in advance!</p>
  
  <pre><code>Sub Resize_Columns_And_Rows_No_Header()
  '
  'Resize_Columns_And_Rows Macro
  '
  'Declaration
    Dim wkSt As String
    Dim wkBk As Worksheet
    Dim temp As Variant
    Dim lastCol As Long
  
    wkSt = ActiveSheet.Name
  ' This Loops Through All Sheets
    For Each wkBk In ActiveWorkbook.Worksheets
        On Error Resume Next
        wkBk.Activate
        lastCol = wkBk.Cells(1, Columns.Count).End(xlToLeft).Column
  'This is only needed if you are wrapping the text
        wkBk.Rows.WrapText = True
  'This is to center align all rows
        wkBk.Rows.VerticalAlignment = xlCenter
  ' Resize Columns
        wkBk.Columns.EntireColumn.AutoFit
  ' Resize Rows
        wkBk.Rows.EntireRow.AutoFit
    Next wkBk
    Sheets(wkSt).Select
  
  End Sub
  </code></pre>