Need to edge out the competition for your dream job? Train for certifications today.
This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.
Dim lngLastRow As Long
Dim lngRow As Long
Dim dblBytes As Double
lngLastRow = Range("A65536").End(xlUp).Row
For lngRow = 1 To lngLastRow
Select Case True
Case InStr(1, Cells(lngRow, 1).Value, "GB") > 0
dblBytes = dblBytes + Val(Cells(lngRow, 1).Value) * 1073741824
Case InStr(1, Cells(lngRow, 1).Value, "MB") > 0
dblBytes = dblBytes + Val(Cells(lngRow, 1).Value) * 1048576
Case InStr(1, Cells(lngRow, 1).Value, "KB") > 0
dblBytes = dblBytes + Val(Cells(lngRow, 1).Value) * 1024
Cells(lngLastRow + 2, 1).Value = Format(dblBytes / 1073741824, "0.00") & " GB"
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.