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: 1
Default Function Problem.... Return Value

I have created a function in a seperate module file that works fine if
I increment through it. The total variable is incremented accuratley,
but I can't get it to return the value. I have a feeling it is
something simple, but am stumped.

The function starts in cell A12 looks for a matching string than reads
the value in the cell 5 columns over. I keep a running total and want
the total displayed in the cell where I call the function from.

I was also battling circular reference problems, but I think I fixed
those.

Here is the code.

Public Function RunTotalKia1()

Dim Total

Range("A12").Select
Do Until ActiveCell.Value = ""
If ActiveCell.Value = "Kia 1" Then
Total = Total + ActiveCell.Offset(0, 5).Value
End If
ActiveCell.Offset(1, 0).Activate
Loop

RunTotalKia1 = Total

End Function

Anyone have any ideas? Thanks in advance.

-Adam
 
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
Carriage Return Problem Don L[_2_] Excel Discussion (Misc queries) 1 March 12th 10 07:04 PM
Return value for a function. Jeff Excel Discussion (Misc queries) 1 June 2nd 08 09:08 PM
Why does this function NOT return a value? Nooby Excel Discussion (Misc queries) 3 May 22nd 06 03:07 PM
Only do Sum function if not "0", IF"0" then return "0" Mike Punko Excel Worksheet Functions 1 June 1st 05 12:20 AM
Function to return value from each tab Steven Leuck Excel Worksheet Functions 1 March 3rd 05 04:11 AM


All times are GMT +1. The time now is 04:15 PM.

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

About Us

"It's about Microsoft Excel"