Solved

Excel Macro

Posted on 2011-09-29
2
193 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now