G
Guest
Here is a problem that is driving me nuts..
A workbook imports data into Sheet1, and this data is analysed using an advanced filter with criteria that are inserted above the data (once imported, blank lines are inserted and a number of criteria sets are pasted as headers into rows 1-7, with the advanced filter called after ie
In this example, header rows and criteria are pasted in rows 1-7, but there is only criteria in A2-K4 (hence the values)
Range("A7:K50000").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange
:=Range("A2:K4"), Unique:=Fals
Selection.SpecialCells(xlCellTypeVisible).Selec
Selection.Cop
Then, in another empty sheet, result is pasted..
Range("A1").Selec
ActiveSheet.Past
Except that the new page is filled with hundreds of empty lines after the data..
Using blank row (based on empty column "A") doesn't help...ie
Selection.SpecialCells(xlCellTypeBlanks).Selec
Selection.Clea
Range("A1:A65535").SpecialCells(xlCellTypeBlanks).EntireRow.Delet
Also, the data seems to occupy too many columns aswell (although i'm sure this is explained by the fact that the imported data uses columns A -> R, but the data is stripped down to A -> K
Hunches are a solution has something to do with pdating active range (although this is Excel XP not 97), and maybe something to do with the "CellTypeVisible" including all blank rows - maybe an alternative operand?
Any help would be greatly appreciated - the processed workbook is 20x bigger !!
Thanks in advance
Mike
A workbook imports data into Sheet1, and this data is analysed using an advanced filter with criteria that are inserted above the data (once imported, blank lines are inserted and a number of criteria sets are pasted as headers into rows 1-7, with the advanced filter called after ie
In this example, header rows and criteria are pasted in rows 1-7, but there is only criteria in A2-K4 (hence the values)
Range("A7:K50000").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange
:=Range("A2:K4"), Unique:=Fals
Selection.SpecialCells(xlCellTypeVisible).Selec
Selection.Cop
Then, in another empty sheet, result is pasted..
Range("A1").Selec
ActiveSheet.Past
Except that the new page is filled with hundreds of empty lines after the data..
Using blank row (based on empty column "A") doesn't help...ie
Selection.SpecialCells(xlCellTypeBlanks).Selec
Selection.Clea
Range("A1:A65535").SpecialCells(xlCellTypeBlanks).EntireRow.Delet
Also, the data seems to occupy too many columns aswell (although i'm sure this is explained by the fact that the imported data uses columns A -> R, but the data is stripped down to A -> K
Hunches are a solution has something to do with pdating active range (although this is Excel XP not 97), and maybe something to do with the "CellTypeVisible" including all blank rows - maybe an alternative operand?
Any help would be greatly appreciated - the processed workbook is 20x bigger !!
Thanks in advance
Mike