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: 2
Default Calling a user Function in Worksheet

Hi....

I am creating an application wherein the data's are present in column
A. Based on the entries in column A, there are a set of formulas to
calculate the result.

i created functions to do this operation. "Line_ID_mm" is one such
function.
When calling this function in worksheet as per the below procedure, it
returns an error #Value.

when executing calculation steps, it doesn't read the value in column
C3, as the Excel function Vlookup reads and returns the required.

What needs to be done in the function to get it resolved.

See the code below:

For calling the Function:

Set proj_sht1 = Workbooks("sample.xls").Sheets("test")
n = Application.CountA(proj_sht1.Range("A:A")) - 1

proj_sht1.Range("O3:O" & n).Formula =
"=Line_ID_mm(VLOOKUP(B3,linesize_in_mm,2,FALSE),C3 )"

Function:

Function Line_ID_mm(Line_size As Integer, Line_Sch As Variant) As
Single

Dim row_num As Integer

row_num = WorksheetFunction.Match(Line_size & Line_Sch,
Range("Sch_num"), 0)
Line_ID_mm = WorksheetFunction.Index(Range("pipe_id_num"), row_num, 8)

End Function

Please advice

S.Ramesh

 
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
Calling VBA function from a worksheet Mike Excel Programming 1 January 14th 08 05:15 PM
Calling Excel user defined function from C# Stanley Excel Programming 0 June 26th 06 02:16 PM
Calling user defined function from C/C++ Ravil Excel Programming 0 April 24th 06 06:05 PM
calling VBA function within a worksheet matelot Excel Programming 2 March 20th 06 06:45 PM
calling a function in a worksheet from a user form steve Excel Programming 1 January 19th 06 10:00 PM


All times are GMT +1. The time now is 02:24 PM.

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"