I want to add 30 weekdays to a date instead of 30 days as is in my existing code but can't quite figure it out. I've set up the following:
But I need to insert somewhere into:
Any suggestions?
VBA Code:
Sub WhyWork()
Dim d1 As Date, wf As WorksheetFunction
Set wf = Application.WorksheetFunction
d2 = wf.WorkDay(Date, 30)
End Sub
But I need to insert somewhere into:
VBA Code:
ActiveSheet.Select
Range("L3").Select
Selection.AutoFilter
Cells.Select
Range("I1").Activate
Selection.EntireColumn.Hidden = False
Columns("E:E").Select
Application.CutCopyMode = False
Selection.Copy
Range("AZ1").Select
ActiveSheet.Paste
Range("AZ3").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Billing Trx Date"
Columns("Q:Q").Select
Selection.Copy
Range("BA1").Select
ActiveSheet.Paste
Range("BA3").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Billing Due Date"
Billdate = Application.InputBox("Enter 1st day of Current Month Billing eg 01-Jan-2015")
StartTRX = "<" & Billdate ' 01/10/15
EndTRX = Application.EoMonth(Billdate, 0) '31/10/15
EndTRX = ">" & EndTRX
StartDue = Application.EoMonth(Billdate, 0) ' 30/11/15
EndDue = Application.EoMonth(Billdate, 1) ' 31/10/15
StartDue = "<=" & StartDue ' due date
EndDue = ">" & EndDue ' due date =
Range("AZ3").Select
Selection.AutoFilter
Range("BC1").Select
ActiveSheet.Range("$A$3:$BA$70000").AutoFilter Field:=52, Criteria1:= _
StartTRX, Operator:=xlOr, Criteria2:=EndTRX
Range("AZ4").Select
Range(Selection, Selection.End(xlDown)).Select
'Range("AZ122").Select
'Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
ActiveSheet.Range("$A$3:$BA$70000").AutoFilter Field:=52
ActiveSheet.Range("$A$3:$BA$70000").AutoFilter Field:=53, Criteria1:= _
StartDue, Operator:=xlOr, Criteria2:=EndDue
Range("BA4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
ActiveSheet.Range("$A$3:$BA$70000").AutoFilter Field:=53
Range("AZ4").Select
pivots
End Sub
Any suggestions?