Peet's code should do it.
Just dont declare the varibles as a specific type, and dont declare parameters as being a specific type either ;
VB Code:
Dim KB Dim MB Dim GB Dim TB KB = 1 MB = 2 GB = 3 TB = 4 Function BytesTO(lBytes, convertto) BytesTO = lBytes / (1024 ^ convertto) End Function Sub Command1_Click() MsgBox BytesTO(2048, KB) End Sub
That *should* work.




Reply With Quote