ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help with filtering dates (https://www.excelbanter.com/excel-programming/378971-need-help-filtering-dates.html)

[email protected]

Need help with filtering dates
 
I have a workbook that does a cost analysis for for several dates that
I am filtering out.
I am going from jan 04: dec 08. My problem is that the way I have my
code written I am getting an error that says my project is too large.
Here is just one of the if statements in the program. Please help!!!


Sheets("Cost Categories").Select
Cells.Select
Selection.AutoFilter
Selection.AutoFilter Field:=4, Criteria1:="Larry Ross"
Selection.AutoFilter Field:=3, Criteria1:="Feb-04"
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
If wscost.Range(" & lrow & ").Value < "" Then
lrow = wscost.Range("a" & _
wscost.Rows.Count).End(xlUp).Row
wscost.Range("a1:ai" & lrow).Copy
x = xjan04 + 2
wscostsort.Range("a" & x).PasteSpecial
lrow = wscostsort.Range("a" & _
wscostsort.Rows.Count).End(xlUp).Row
xfeb04 = lrow + 1
wscostsort.Range("h" & xfeb04).Formula = "=sum(h" & x & ":h" & lrow &
")"
wscostsort.Range("h" & xfeb04, "ah" & xfeb04).FillRight
wscostsort.Range("ai" & xfeb04).Formula = "=SUM(AF" & xfeb04 & "/((AH"
& xfeb04 & "*6)+AG" & xfeb04 & "))"

End If

I substitute Feb 04 with the next month in the order all the way to dec
08. Thanks in advance!!!



All times are GMT +1. The time now is 05:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com