title: Formatting numbers using VBA
body: <p>I recorded a macro to convert a csv file to columns.<br />
  I cannot format the two columns with numbers. I tried recording several scenarios and adding different commands.</p>
  <p>The data looks like this:</p>
  <p>Before Formatting<br />
  <a href="https://i.stack.imgur.com/jMjql.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jMjql.png" alt="enter image description here" /></a></p>
  <p>After Formatting<br />
  <a href="https://i.stack.imgur.com/hyJ3l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hyJ3l.png" alt="enter image description here" /></a></p>
  <p>My code works for Text to Columns:</p>
  <pre class="lang-vb prettyprint-override"><code>Selection.TextToColumns Destination:=Range(&quot;A1&quot;),DataType:=xlDelimited, _
    TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
    Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
    :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5,   1), Array(6, 1), _
    Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1)), TrailingMinusNumbers:=True
  Columns(&quot;E:F&quot;).Select
  Selection.Replace What:=&quot;.&quot;, Replacement:=&quot;,&quot;
  </code></pre>
  <p>I’ve tried recording whilst I format the cells using keyboard shortcuts, and an attempt to write some coding; amongst others:</p>
  <pre><code>'NumberFormat = &quot;#.##0,00&quot;
  
  Columns(&quot;E:F&quot;).Value = Columns(&quot;E:F&quot;).Value
  
  With Range(&quot;E:F&quot;)
      .NumberFormat = &quot;0&quot;
      .Value = .Value
  End With
  </code></pre>
  <p>I’m working on a Danish keyboard.</p>