Solved

Excel Macro

Posted on 2011-09-29
2
195 Views
Last Modified: 2012-05-12
A part of my macro tells about the expiration of a quant. Can any one tell me by looking at the below code in how many days a quant is kept after expiration
Sub ExpiredQuantDate()

'
    Application.Goto Reference:="QDate"
    Selection.NumberFormat = "yyyy/mm/dd"
    ActiveWindow.SmallScroll Down:=-4
    Range("B6:O6").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.sort Key1:=Range("F6"), Order1:=xlAscending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    Selection.sort Key1:=Range("F6"), Order1:=xlDescending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    Application.Goto Reference:="QDate"
    Selection.NumberFormat = "m/d/yyyy"
    ActiveWindow.SmallScroll Down:=-4
    Range("D1:L1").Select
End Sub

Open in new window

0
Comment
Question by:Svlss
2 Comments
 
LVL 24

Expert Comment

by:StephenJR
ID: 36814859
That macro is just concerned with fomatting and sorting data. What is a quant?
0
 
LVL 19

Accepted Solution

by:
akoster earned 500 total points
ID: 36814885
No, this is not possible from the code alone.

The code selects the QDate cell or range, scrolls up 4 cells, sorts all used cells in the columns B up to O (starting from row 6 downwards), and finally selects the range D1 up to L1. In the code no reference to quants or expiry dates whatsoever exist.

Looking at the code, i suspect either other code fragments or conditional formatting / hiding rows is used to expire a quant but in order to verify this, you need to upload the worksheet this code resides in.

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question