Programs1234
08-15-2017, 10:28 AM
For some reason my code fails at the last line here:
Sub credit_monitor()
Dim FileName1 As String
Dim LR As Long
Dim TaxRate As String
Dim SumAllCountries As Variant
Dim LR2 As Variant
Dim LR3 As Variant
Dim xdate As String
Dim fname As Variant
Dim fname2 As Variant
Dim NextBusinessDay As Variant
FileName1 = Workbooks("Macros").Sheets(1).Cells(7, 2)
Workbooks(FileName1).Activate
Workbooks(FileName1).Sheets(1).Select
xdate = Cells(8, 2)
FR = Range("A" & Rows.Count).End(xlUp)
NextBusinessDay = Workbooks("Macros").Sheets(1).Cells(9, 2)
'Fix Tax Rate to 100
ActiveSheet.Range("A1:Q1").AutoFilter Field:=17, Criteria1:="FIM"
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("K2:K" & LR).SpecialCells(xlCellTypeVisible).Select
TaxRate = "100"
Range("K2:K" & LR).SpecialCells(xlCellTypeVisible) = TaxRate
Range("A1:Q1").AutoFilter
'Sort End Date for Blank spaces and replace with 12/31/2099
ActiveSheet.Cells(1, 15).AutoFilter Field:=15, Criteria1:=""
'Range("O2:O" & LR).SpecialCells(xlCellTypeVisible) = "12/31/2099"
Range("A1:Q1").AutoFilter
'Sort End Date by tomorrow and finds and returns sum of collateral levels to macros sheet
ActiveSheet.Cells(1, 15).AutoFilter Field:=15, Criteria1:=NextBusinessDay, Operator:=xlFilterDynamic <-------- This is where it fails
If anybody can help, that'd be great.
Sub credit_monitor()
Dim FileName1 As String
Dim LR As Long
Dim TaxRate As String
Dim SumAllCountries As Variant
Dim LR2 As Variant
Dim LR3 As Variant
Dim xdate As String
Dim fname As Variant
Dim fname2 As Variant
Dim NextBusinessDay As Variant
FileName1 = Workbooks("Macros").Sheets(1).Cells(7, 2)
Workbooks(FileName1).Activate
Workbooks(FileName1).Sheets(1).Select
xdate = Cells(8, 2)
FR = Range("A" & Rows.Count).End(xlUp)
NextBusinessDay = Workbooks("Macros").Sheets(1).Cells(9, 2)
'Fix Tax Rate to 100
ActiveSheet.Range("A1:Q1").AutoFilter Field:=17, Criteria1:="FIM"
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("K2:K" & LR).SpecialCells(xlCellTypeVisible).Select
TaxRate = "100"
Range("K2:K" & LR).SpecialCells(xlCellTypeVisible) = TaxRate
Range("A1:Q1").AutoFilter
'Sort End Date for Blank spaces and replace with 12/31/2099
ActiveSheet.Cells(1, 15).AutoFilter Field:=15, Criteria1:=""
'Range("O2:O" & LR).SpecialCells(xlCellTypeVisible) = "12/31/2099"
Range("A1:Q1").AutoFilter
'Sort End Date by tomorrow and finds and returns sum of collateral levels to macros sheet
ActiveSheet.Cells(1, 15).AutoFilter Field:=15, Criteria1:=NextBusinessDay, Operator:=xlFilterDynamic <-------- This is where it fails
If anybody can help, that'd be great.