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")
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")
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
bump- thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks