#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default File size function

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
reduce the size of a file Jason M Excel Discussion (Misc queries) 3 October 31st 06 04:10 PM
Is there any File Auto Save Function for Excel and Word 2007 (Bet Mr. Low Excel Worksheet Functions 2 June 16th 06 12:26 PM
VLOOKUP from closed file using INDIRECT function Ben Excel Worksheet Functions 3 May 17th 06 01:58 AM
Importing .txt data files increases .xls file size BrianJ Excel Discussion (Misc queries) 1 January 29th 05 02:02 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM


All times are GMT +1. The time now is 06:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"