Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is a follow up to a previous post - but I have got a much better start
Here is what I have put together so far Sub FindOrCreate( Application.DisplayAlerts = Fals Dim MyPath As Strin Dim sh As Workshee Workbooks.Open (ThisWorkbook.Path & "\ReportOne.xls" Set sh = ActiveWorkbook.ActiveShee With s .Columns("A:I").AutoFilter Field:=8, Criteria1:="January .Columns("A:I").AutoFilter Field:=9, Criteria1:="2004 .Columns("A:I").SpecialCells(xlCellTypeVisible).Co p If Dir(ThisWorkbook.Path & "\ProgramData\FileData\StoredData\January2004.xls" ) < "" The 'Ope Workbooks.Open (ThisWorkbook.Path & "\ProgramData\FileData\StoredData\January2004. xls" Els 'Creat Workbooks.Ad Sheets("Sheet2").Selec ActiveWindow.SelectedSheets.Delet Sheets("Sheet3").Selec ActiveWindow.SelectedSheets.Delet End I Sheets("Sheet1").Range("A1").PasteSpecia .Columns("D:D").AutoFilte End Wit Application.DisplayAlerts = Tru End Su I have a couple of issues to fix though. I need to make sure that it appends the data that is being copied at the end of whatever current data exists. Also as before all of this contains hard coded values and I have to change that, but I am completely clueless as to how to do that. It has to do the sort for date (month and year) copy that and then open or creat the file based on that date - paste the data - then continue through the origional file and take out any other month and year that is available. (as before no origional data file will contain more than three combinations of month and year).So basically all of the code above where it says "January2004", that value would have to come from the data sorted and the value in fields 8 & 9 Any help on this would be greatly appreciated, as this is really my only hold up, after this I just have to generate reports off of this data, and all of that I know how to do Thanks in advance for any help or advice James Stephens |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a way to Auto sort or save a sort? | Excel Discussion (Misc queries) | |||
save sort order ? | Excel Discussion (Misc queries) | |||
how do i save the sort settings | Setting up and Configuration of Excel | |||
Auto sort & save | Excel Worksheet Functions | |||
Sort and Save File by Date | Excel Programming |