+ Reply to Thread
Results 1 to 4 of 4

What does this line of code mean? Variable Date/Opening Files

  1. #1
    Forum Contributor
    Join Date
    03-14-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    491

    What does this line of code mean? Variable Date/Opening Files

    Please Login or Register  to view this content.
    Should I name the range of the cell in the workbook that holds the As of Date to "AsofDate" for this to work?

    Ultimately i'm looking to open a file and I want to have a variable date in the file name.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: What does this line of code mean? Variable Date/Opening Files

    "AsofDate" in Range("AsofDate") is referring to a named range within the worksheet. A named range could be 1 or multiple cells of data. AsofDate as a variable will return the date in format "MMM-DD" of Range("AsofDate") if the named range is 1 cell. It will error if "AsofDate" is multiple cells.

  3. #3
    Forum Contributor
    Join Date
    03-14-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    491

    Re: What does this line of code mean? Variable Date/Opening Files

    Quote Originally Posted by stnkynts View Post
    "AsofDate" in Range("AsofDate") is referring to a named range within the worksheet. A named range could be 1 or multiple cells of data. AsofDate as a variable will return the date in format "MMM-DD" of Range("AsofDate") if the named range is 1 cell. It will error if "AsofDate" is multiple cells.
    Thank You, and is this regardless of what worksheet I designate the "AsofDate" on?

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: What does this line of code mean? Variable Date/Opening Files

    A named range is either worksheet specific or cannot be duplicated. I am not sure if this information answers your question

+ 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. [SOLVED] Opening and saving files that have a date in the file name
    By jgscanlon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2014, 03:32 PM
  2. Code Problem, Need Advice on opening Files
    By kmraz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-22-2013, 11:49 AM
  3. Broken code for copying files and opening a workbook
    By stojko89 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-04-2011, 07:55 AM
  4. Problem opening files within code
    By Dom W in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2011, 12:26 PM
  5. Opening Old Excel Files - Line @ Top
    By webermis in forum Excel General
    Replies: 4
    Last Post: 04-22-2005, 04:06 PM

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