+ Reply to Thread
Results 1 to 3 of 3

Dropped Values

  1. #1
    Registered User
    Join Date
    07-23-2007
    Posts
    2

    Dropped Values

    Hi! I'm running a macro that has several parameters being passed

    My cell reads like this

    =DoWho(A1,c1,f1,g1,k1,L1)

    When I use the pulldown to fill in the variables with cell references it shows the values of each parameter cell I reference.

    Problem is that once in the function, some of the parameters come in as null
    If I throw a stop into the function and place my cursor over the parameter names YesterdayShares alwasy shows the passed value and YesterdaysAction is usually correct, but lowTrig,HighTrig,TodHigh and TodLow will often be empty or 0, even though the data is in the referred cells and when I click on the function helper I see the data on the right side of the screen.

    any help is appreciated!


    Function DoWho(YesterdayShares, YesterdaysAction, LowTrig,HighTrig,TodHigh, TodLow)

    DoWho = ""

    If YesterdayShares > 0 And TodLow < LowTrig Then
    DoWho = "CoverLong"
    GoTo endDh
    End If

    If YesterdayShares < 0 And TodHigh > HighTrig Then
    DoWho = "CoverShort"
    GoTo endDh
    End If

    endDh:
    End Function

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Please use Code Tags when posting code - see Item #2 of the Rules

    http://www.excelforum.com/showthread.php?t=591596

    Why not use an nested IF Function instead of a UDF?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-23-2007
    Posts
    2
    sorry about the wrapping, I looked at rule two and didn't see anything that referenced "Wrapping"...and I actually am a neophyte at this.

    Not sure what you mean by using the "If"

    I suppose too that I mis-used the workd macro. Basically I have a worksheet populated with data from a Access file and on each row there is a cell that calls the function I mentioned. Works like any other function in that I pass parameters and expect a value to be returned.

    Again, the problem is that even tho there is data in the cells that are referred to when it drops into the function some of those values are not there. I'd like to know why and how to fix it.

    Thoughts?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1