LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default function trouble

I have this function:

Function hoogste(Optional maxweek As String) As String

Dim sh As Worksheet, sName As String
Dim maxindex As Long

maxweek = 0
maxindex = 0
For Each sh In ActiveWorkbook.Sheets
sName = sh.Name
If IsNumeric(sName) Then
If CLng(sName) < 53 Then
If CLng(sName) maxweek Then
'maxweek = CLng(sName)
maxweek = sName
maxindex = sh.Index
End If
End If
End If
Next
hoogste = "1:" & maxweek
End Function

It returns 1:12 if my highest sheetname is 12.

Now i want to sum cel c10 of all sheets 1 to 12

=SUM('1:12'!C6)
Every time my highest number is an other so i would like to use
=SUM('hoogste()'!C6)

this does not work, what am i doing wrong?

Greetings Hans

PS i use excel 2003


 
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
Having trouble with function. Not sure what's wrong Excel Worksheet Functions 0 March 28th 07 02:14 AM
Having trouble with function. Teethless mama Excel Worksheet Functions 1 March 28th 07 02:11 AM
Having trouble with AVG Function [email protected] Excel Worksheet Functions 2 August 17th 06 09:19 AM
Having trouble finding the right function g New Users to Excel 2 June 4th 06 11:37 AM
IF function trouble raye Excel Worksheet Functions 2 August 28th 05 01:43 AM


All times are GMT +1. The time now is 08:25 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"