Improve company productivity with a Business Account.Sign Up
The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.
One of a set of tools we're offering as a way of saying thank you for being a part of the community.
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.