View Single Post
  #2   Report Post  
PeterAtherton
 
Posts: n/a
Default

Hi

I've written a couple of functions that will give you what you want. Copy
them into a Visual basic module in your book. (ALT+F11,Insert,Module). You
can thenuse the functions as normal.

Function fName()
Dim wb As Workbook
Set wb = ActiveWorkbook
fName = wb.Name
End Function

Enter =fname() in a cell to return the current file name.

Function ColWidth(c)
Application.Volatile
ColWidth = c.ColumnWidth
End Function

In A1 type =colwidth(A1) to return the column width in the format you want.

You could have used Excel's CELL function to return the column width to the
nearest whole number.

e.g =CELL("Width",D7)

regards
Peter



"nopfusch" wrote:

1 How do I enter as a function the current filename or another filename
into a cell?
If I click on the cell coyaining another filename, the file should open. Is
it possible without macros, if the (another) file is in the same folder?
2 I want to display in line one, for each coloum the width, e.g. 6.33.
The nummer representing the width should - if I change the width - change
accordingly .
Possible???
Thanks
nopfusch