Updated but still not working
Sub StorageTotal()
Dim FTP As Worksheet
Dim RowNo As Long, LastRow As Long
Dim Total As Integer
Dim GB As String, MB As String, KB As String
Dim GBCon As Double, MBCon As Double, KBCon As Double
Dim GBRT As Double, MBRT As Double, KBRT As Double
Dim TotalCalc As Double
Set FTP = ThisWorkbook.Worksheets("FTP Register")
With FTP
LastRow = FTP.Cells(.Rows.Count, "A").End(xlUp).Row
For RowNo = 2 To LastRow
If InStr(1, FTP.Cells(RowNo, "B"), "GB", vbTextCompare) = "1" Then
GB = FTP.Cells(RowNo, "B")
GB = Right(GB, Len(GB) - 2)
GBCon = Val(GB)
GBRT = GBRT + GBCon
ElseIf InStr(1, FTP.Cells(RowNo, "B"), "MB", vbTextCompare) = "1" Then
MB = FTP.Cells(RowNo, "B")
MB = Right(MB, Len(MB) - 2)
MBCon = Val(MB)
MBRT = MBRT + MBCon
ElseIf InStr(1, FTP.Cells(RowNo, "B"), "KB", vbTextCompare) = "1" Then
KB = FTP.Cells(RowNo, "B")
KB = Right(KB, Len(KB) - 2)
KBCon = Val(KB)
KBRT = KBRT + KBCon
ElseIf InStr(1, FTP.Cells(RowNo, "B"), "Empty", vbTextCompare) = "1" Then
End If
Next
TotalCalc = GBRT + (MBRT / 1024) + ((KBRT / 1024) / 1024)
FTP.Cells(17, "L") = TotalCalc
End With
End Sub
Bookmarks