+ Reply to Thread
Results 1 to 3 of 3

VBA Dynamic Variables

  1. #1
    Registered User
    Join Date
    09-29-2014
    Location
    TIjuana, Mexico
    MS-Off Ver
    MSO 2010, MSO 2013
    Posts
    53

    Question VBA Dynamic Variables

    Hi guys, basically what I'm trying to do is create variables on the run.

    I have data that runs daily. From Tuesday to Friday/Saturday there's no problems.
    On Monday, it runs data from the last workday (Friday or Saturday) and I need to retrieve that.
    Another thing to consider is that if there are holidays. That issue was solved with an input box where users type in the number of days in the past they want to analyze.

    In the end, weekends and/or holidays have more than 1 single date in the past. I need the macro to loop through the range of dates and find each unique value, store it in a variable, which I will later use to create a table and pivot it.

    I am completely lost in this and have had no success searching the web for an answer or an approach to it

    Hope I was clear enough, if you need some code I'll be happy to share.

    Thanks in advance

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA Dynamic Variables

    Hello MarBoTJ,

    Since you are using a Pivot Table, save the data to a predetermined range on one of your worksheets eliminating the need to create variables.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    09-29-2014
    Location
    TIjuana, Mexico
    MS-Off Ver
    MSO 2010, MSO 2013
    Posts
    53

    Re: VBA Dynamic Variables

    I think I need to repost this in a different approach. Will close this thread and instead start a new one with my new question. Thanks anyways!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to set a dynamic sheet or a line number dynamic from variant variables
    By skulo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2015, 09:58 AM
  2. [SOLVED] Dynamic Variables
    By kreitzig in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-26-2012, 01:01 PM
  3. Get value from Dynamic Variables
    By NTB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2012, 01:28 AM
  4. Can you use Dynamic Variables in UDFs?
    By tom.hogan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2011, 11:59 AM
  5. Dynamic variables
    By ramzy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-22-2008, 08:50 AM
  6. Dynamic variables in .WebTables
    By andym in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-05-2005, 07:10 AM
  7. [SOLVED] Add up a Dynamic Range with 2 Variables
    By John in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-15-2005, 01:06 PM

Tags for this Thread

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