To format, the Property Range.Numberformat is used.
Dim rng As Range
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Planilha1")
Set rng = ws.Range("B:B", "E:E")
With rng
.NumberFormat = "#,##0.00"
End With
Explanation of the code
Spreadsheet (Worksheet)
Declares the worksheet to be used in VBA
Dim ws As Worksheet: Set ws = ThisWorkbook.Sheets("Planilha1")
Range
Declares the range to be used, in this case columns B and E.
Dim rng As Range: Set rng = ws.Range("B:B", "E:E")
Logic With (with)
Use with to realize what’s inside With and End With only within the Range rng
With rng
End With
Format
Format for numbers with two decimal places
.NumberFormat = "#,##0.00"
Other way to use and declare this code
Dim rng As Range
Set rng = Planilha1.Range("B:B", "E:E")
rng.NumberFormat = "#,##0.00"
Check the Numberformat
To check some cell formats, click More Number Formats
Check in the Custom Category, some examples of Numberformat
How many decimal places after the comma?
– danieltakeshi