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: 206
Default custom function

hi all,

i have a range of data that will be something like this:

1 case
10 cases
100 cases

my cell formula is
=SUMPRODUCT((CustomerOrdersCode=H1)*(formatQuantit y(CustomerOrdersQuantity)))
i am using a cell formula with SUMPRODUCT to determine the total number of
cases
i am having trouble stripping the text from the data and converting it to an
integer
i thought to use a function like:

Public Function formatQuantity(q As Range) As Integer
Dim i As Integer, c
For Each c In q.Cells
For i = 1 To Len(c.value)
If Mid(c.value, i, 1) = " " Then Exit For
Next i
formatQuantity = CInt(Mid(c.value, 1, i))
Next
End Function

i'm not exactly sure how to modify it to accept/return the correct values.

any help - or possibly a better idea?

tia!

J
 
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
Custom Function: Detecting the cell the function is used in g-boy Excel Programming 2 June 11th 05 06:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
custom function - with built-in function VilMarci Excel Programming 14 January 25th 05 04:15 PM
Help with Custom Function Flamikey[_7_] Excel Programming 1 November 11th 04 04:13 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM


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