Tamaño del archivo del formato de número de VBA VBA
[<1000000]0.00," KB";[<1000000000]0.00,," MB";0.00,,," GB"
Quaint Quetzal
[<1000000]0.00," KB";[<1000000000]0.00,," MB";0.00,,," GB"
Select Case objFile.Size
Case 0 To 1023
Cells(NextRow, "D").Value = Format(objFile.Size, "0") & "B"
Case 1024 To 1048575
Cells(NextRow, "D").Value = Format(objFile.Size / 1024, "0") & "KB"
Case 1048576 To 1073741823
Cells(NextRow, "D").Value = Format(objFile.Size / 1048576, "0") & "MB"
Case 1073741824 To 1.11111111111074E+20
Cells(NextRow, "D").Value = Format(objFile.Size / 1073741823, "0.00") & "GB"
End Select