Consulting

Results 1 to 2 of 2

Thread: VBA-Import text file of yesterday's date which is the file name

  1. #1
    VBAX Newbie
    Joined
    Mar 2021
    Posts
    1
    Location

    VBA-Import text file of yesterday's date which is the file name

    I am new in Excel VBA and macros and I am facing some difficulties in coding. I am working in a daily data that are placed in a folder everyday, I need a code to import the file of yesterday's date whenever I run the macro. Any suggestions?

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Dim YesterdayName as string
    YesterdayName = Format(Date-1, "FormatString") & ".xlsm"
    It takes a bit more code if you skip Weekends/Holidays and such
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •