Skip to Content
author's profile photo Former Member
Former Member

Is there a way to prompt for a date range on a macro?

Do any of you know if there is a way to prompt for a date range on a macro rather than having the macro run for the same fixed date range? A consultant we had said this couldn't be done but I thought I would ask the community.

The situation is that one time we would want to run a macro for example the current period only. The next time we want that same macro to run for current period out 3 periods. The next time maybe next period only. And so on. With out a prompt situation this would require three different macros to accomplish this.

If you have done this please kindly provide an example of the macro details that I can review.



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jun 14, 2012 at 06:11 PM


    You can use the macro function CHAR_VALUES_INPUT to prompt the user to provide a character value. If you need a range, it is required to prompt twice to record the user input. For dates, the required format will be YYYYMMDD and use DATE macro function to convert this input into a date (numeric value).

    If your macro needs to execute always from the current period (say first column of data view), you may also think about providing number of columns to be considered rather than providing a date range. It simplifies the macro implementation.

    Another easy approach will be selecting the required columns (i.e. entire column similar to excel) that require macro execution. In macro implementation, you can use COLUMN_MARKED function to check whether a column is selected. If so, execute the macro. In this way, the user can pick any column. This is much simpler and requires just one IF condition.

    Please check the following link for available macro functions and syntax.


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Rajesh, thank you for your prompt response and informative reply! I tried that COLUMN_MARKED function and it seems to work like a charm. I will present this to the busines to see if this will solve there issue.


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.