View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default File size function

How about a little macro:

Option Explicit
Function HowBig(Optional rng As Range) As Double

If rng Is Nothing Then
Set rng = Application.Caller
End If

HowBig = 0
If rng.Parent.Parent.Path = "" Then
'never saved
Exit Function
End If

HowBig = FileLen(rng.Parent.Parent.FullName)

End Function

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel to test it out.

Put
=howbig()
in an empty cell



msdrolf wrote:

Is there a function or command which will input the size of the file I am
working on into a specified cell. I know I can look in Properties but I
need the file size to be entered into a cell which I can then link to a
summary spreadsheet which will list about 200 files and their file sizes.


--

Dave Peterson