LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Freeman
 
Posts: n/a
Default How to create a function using references

I am trying to create a VB function to calculate some data on between 2 excel
workbooks. I have got this to work using a "sum if" statement with nested
"if" within the cells of the workbook. WB 1 has data in tables and WB 2 has
the calculated totals. Here is the basic layout of the 2 WB.

WB1:

Date Account# Amount($) Cleared
Jan 30, 06 123456 20.00 No
Jan 31, 06 145678 50.00 Yes


WB2:

Date Total
Jan 20, 06 "location of the sum if statement"
Jan 21, 06 "location of the sum if statement"

The above works fine for now, but I want to create a function that I can
call to automate the process. I have a couple of problems doing this:

1) How do I pass a reference to a range of cells to a function
ie: $F$2:$F$12
2) How do I extract the beginning and end of that range and make variables
equal to those figures.
ie: x = $F$2
y = $F$12
3) I want to loop from "x" to "y" and during that loop use "x" to lookup the
cell data so I can use it to compare values and update a total using "if"
statements.

Really my biggest problem here is the issue of using pointers in between
Excel and VB. Does anyone have any ideas?? What are the limits of doing
this??
 
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
VBA function for "Mean" using Array as argument ASokolik Excel Worksheet Functions 21 March 28th 06 10:05 PM
create pivot table formula without the GETPIVOTDATA function ebergkes Excel Discussion (Misc queries) 3 November 11th 05 12:25 AM
Sumif function with remote cell references hennis Excel Worksheet Functions 1 August 12th 05 01:54 AM
What function would I create? pookie1394 Excel Worksheet Functions 0 March 11th 05 03:07 PM
Using CONCATENATE function to create email addresses from a list Almamba Excel Worksheet Functions 2 January 23rd 05 09:10 PM


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