Results 1 to 7 of 7

Thread: Resolved: Pulling VBA Func Result into Cell (Excel)

Threaded View

  1. #1

    Thread Starter
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Resolved Resolved: Pulling VBA Func Result into Cell (Excel)

    Ok, hopefully this will be clear.
    I have an Excel worbook that has a number of wroksheets, each of which do a number of rather complex calculations. A lot of these calculations are based upon rates. Fortunatly these rates are found in a database, and I've added a macro sub that, when run will log into the database and run a stored procedure that will return the rate values based on a date range found on sheet 1. With me so far?

    Ok, so now, I have all these rates on a new sheet in the workbook. Because these rates can change over time, there's some calculations that go on in the worksheet to prorate the rates and calc a new "blanded" rate.

    Still with me?

    So what I'd like to do now, is to pull the rates into the appropriate places on the individual sheets. If I could, I would simply goto the destination cell and punch in =RateSheet!A23. But that won't work, since if a new rate is added, the rate will no longer be in cell A23, but could be in A24, or A30 even. So that's no good.

    I haven't lost you yet have I?

    So, I worte a VBA function, that given a name, looks through the list on that sheet, find the named rate and returns the value. Sounds simple. Except that I cannot for the life of me figure out how to call my VBA Func from the cell so that the value shows up. Know what I mean? Does any one know if it's possible? I tried as VLookupTable but that didn't work out too well.



    Tg
    Last edited by techgnome; Dec 10th, 2004 at 11:22 AM. Reason: Resolved
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width