+ Reply to Thread
Results 1 to 3 of 3

Part of mask from cell ref

Hybrid View

somesoldiers Part of mask from cell ref 07-24-2012, 10:24 AM
somesoldiers Re: Part of mask from cell ref 07-25-2012, 04:18 AM
somesoldiers Re: Part of mask from cell ref 07-30-2012, 10:14 AM
  1. #1
    Forum Contributor
    Join Date
    04-23-2009
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003 work, 2007 home
    Posts
    199

    Part of mask from cell ref

    Hi Guys

    can you advise how I can amend the below code to pick up the date from cell A1 rather than Today -3. Date will be in format YYYYMMDD

    thanks

    Noel


    MyMask = "*FeeRebateSummary*" & Format(Date - 3, "YYYYMMDD")

  2. #2
    Forum Contributor
    Join Date
    04-23-2009
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003 work, 2007 home
    Posts
    199

    Re: Part of mask from cell ref

    Full code attached- am trying to avoid the situation where I need a different macro for Mondays and weekdays as the file picked up is received T-1

    thanks

    Noel

    Sub OpenDBFeeRebateMon()
    
    Workbooks.Add
    
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "DBMultiFileFeeRebate"
    Range("A2").Select
    ActiveCell.FormulaR1C1 = "DBMultiFileFeeRebate"
    
    Dim MyFileName, MyPath As String, MyMask As String
    Dim MyBook As Workbook
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    
    MyPath = "N:\Aexeo Clients\Integration\ConnectivityDrops\DB\"
    MyMask = "*FeeRebateSummary*" & Format(Date - 3, "YYYYMMDD")
    MyFileName = Dir(MyPath & MyMask & "*.csv")
    Do Until MyFileName = ""
    Workbooks.Open MyPath & MyFileName
    Set MyBook = ActiveWorkbook
    Application.Run "MergeFiles"
    
    MyBook.Close
    MyFileName = Dir
    Loop
    
    Windows("Book2").Activate
    
    ActiveWorkbook.SaveAs FileName:="N:\Aexeo Clients\Integration\ConnectivityDrops\DB\Test\" & Range("A1") & Format(Now(), " YYYYMMDD") & ".csv" _
    , FileFormat:=xlCSV, CreateBackup:=False
    ActiveWorkbook.Save
    ActiveWorkbook.Close
    
    
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    
    
    End Sub

  3. #3
    Forum Contributor
    Join Date
    04-23-2009
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003 work, 2007 home
    Posts
    199

    Re: Part of mask from cell ref

    bump- thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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