Converts a figure represented in bytes to the corresponding figure in megabytes, formatted to two decimal places. With a little modification, this could also be converted into a multi-value converter for kilobytes, gigabytes, terabytes, petabytes, etc.
Public Function BytesToMegabytes(Bytes As Double) As Double
'This function gives an estimate to two decimal
'places. For a more precise answer, format to
'more decimal places or just return dblAns
Dim dblAns As Double
dblAns = (Bytes / 1024) / 1024
BytesToMegabytes = Format(dblAns, "###,###,##0.00")
End Function