title: How to change the number format of a column in vba
body: <p>I am trying to use a user selection to alter the number format of a column inside that selection. The number format I am attempting to change it to is Accounting. The code I have tried is below.</p>
  
  <pre><code>Dim r As Range
  Dim s As String
  s = Selection.Address(ReferenceStyle:=xlA1, RowAbsolute:=False, ColumnAbsolute:=False)
  r = Range(s).Columns("G")
  r.NumberFormat = "$#,##0.00"
  </code></pre>
  
  <p>I know for sure that String s gets the correct string value of the user selection. Getting the range of just column G is what seems to be incorrect.</p>