I wish to return the file size of some files in the same folder or in a different one with VBA in Excel 2010.
相关问题
- Keeping track of variable instances
- How to get the maximum of more than 2 numbers in V
- F#: Storing and mapping a list of functions
- Converting a string array to a byte array
- Error handling only works once
相关文章
- Accessing an array element when returning from a f
- Unregister a XLL in Excel (VBA)
- Understanding the difference between Collection.is
- Equivalent to window.setTimeout() for C++
- How can I write-protect the Matlab language?
- Java Equivalent to iif function
- numeric up down control in vba
- Declare a Range relative to the Active Cell with V
This is in reply to the question regarding the use of the semicolon
;
as a parameter seperator.In locals (like US) which use the point/fullstop
.
as a decimal point, the coma,
is used as a list seperator, in this case as a seperator in the list of parameters to VBA functions and procedures.In other locals (like DE and Europe in general), where the decimal point is the coma
,
things would get confusing if the same symbol was used as a list seperator, so the semcolon;
is being used insteadThere is a very nice and simple VBA function, which was not mentioned so far, FileLen:
FileLen("C:\Temp\test file.xls")
It returns the size of the file in bytes.
In combination with looping through files in a directory it's possible to achieve what you originally wanted (get sizes of files in a folder).
Here how to use it in Excel Cell:
If you have a german Windows than:
Here is the function for the VBA modul: (Just enable the Developer tools, and copy and paste this into a new modul)