I am trying to make a query that returns on what date a security in the current inventory entered a portfolio in Access.
The data is stored as trades which are summed to give the current inventory.
My first approach was to take to current inventory and try to back out the trades until the position would be zero, but I could not figure out a way to do a running sum Unitl that would be completed in reverse chronology in access.
Any help would be appreciated
I have come across this only a couple times and have tried in vain to find out what the "--" does in formulas
one example I have run accross in the forums is below
Also, is there a good refrence source for formulas like this?
Re: Find Text/Value & Use Found Cell, Row, Column In Macro Code
Thanks for the quick reply! I have learned most of what I know about VBA from bouncing around on this site and look forward to learning enough to help others.
The following code does exactly what I was looking for, but I would appreciate further pointers, especially on how I asked the question so others know what I am talking about.Code
- Function Findcell(FindText As Variant) As Range
- Set Findcell = Cells.Find(What:=FindText, After:=Cells(1, 1), LookIn:=xlFormulas, _
- LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
- End Function
- 'The following tests the function above
- Sub test()
- Dim Jakecell As Range
- Dim Joecell As Range
- Set Jakecell = Findcell("jake")
- Set Joecell = Findcell("joe")
- Range(Cells(Jakecell.Row, Jakecell.Column), Cells(Joecell.Row, Joecell.Column)).Select
- End Sub
Thanks again for the help and maintaining this site :drum:
I am trying to clean up and simplify my macros by compartmentalizing frequently repeated commands.
I like to search for text in column headings and define the cell containing it as a range that I can later use .column or .row commands on, so my macros are a bit more flexible.
The code I currently use for this is
I would like to be able to create a Macro (possibly name FindSetCell()) that will accept arguments and achieve the results of the above code in other macros
I think the command might look something like
FindSetCell(“text to be searched for”,”name of newly Defined Range”)
But I have not figured out how to code it
Any help would be much appreciated,