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: 89
Default v.basic misc programming ?

something basic is wrong, (boy do i feel stupid)

on my worksheet i have the user defined funtcion entered like this:
TotalAmount(E11,B20)

the function in part reads like this (i've reduced it as much as possible,
so as is, it may sound a little curious, but this should isolate my
problem -i don't work) :

Public Function TotalAmount(Name)
Application.Volatile
Dim r as integer
r = 3
Dim SubTotal
SubTotal = 0
With Worksheets(Sheet2)
Do While r < 250
If .Range("B" & CStr(r)).Value =
worksheets(sheet1).range("Name").value Then
SubTotal = SubTotal + .Range("D" & CStr(r)).Value
End If
r = r + 1
Loop
End With
TotalAmount = SubTotal
End Function


thanks in advance,
mark


 
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
Visual Basic Programming for Excel Venkatesh New Users to Excel 4 August 6th 07 11:48 AM
misc [email protected] Excel Discussion (Misc queries) 0 August 25th 06 12:04 AM
Visual Basic programming Jannick Excel Discussion (Misc queries) 2 February 27th 06 02:23 PM
A few problems Programming to the Visual Basic Editor Chip Pearson Excel Programming 2 September 17th 03 05:18 AM
Visual Basic Programming Difficulties with linking Userforms Chuckie Excel Programming 2 August 7th 03 09:08 PM


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

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"