LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Simple question concerning VBA functions

Great!

With -command solved the issue.

Thanks

Br
Vepa

"Vepa" wrote:

Hello,

I have a very simple but a painful problem concernign one VBA function that
I have created.

My code is the following:
Function test(cl)
Start_row = WorksheetFunction.Match(cl, Sheets("Sheet1").Range("A:A"), 0)
End_row = WorksheetFunction.CountIf(Sheets("Sheet1").Range(" A:A"), cl)
test = WorksheetFunction.Sum(Sheets("Sheet1").Range(Cells (Start_row, 2),
Cells(End_row, 2)))
End Function
----
The problem is that if I change to the test row "Sheet2", suddenly I get
always #Value errors. However, when I look all the information from the same
sheet there is no error.

Do you know, how to get the code to work so that Start_row and End_row are
looked from the Sheet1, and then the sum between these rows is calculated
from the data of sheet2?

Br
Vepa



 
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
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
A few simple functions Grey Excel Discussion (Misc queries) 1 July 15th 06 11:45 AM
simple date and time functions marquis de montrose Excel Discussion (Misc queries) 2 December 6th 05 11:13 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM


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