D
Dennis
Using XL 2003
256MB Ram
2.1 GH Intel
80G HD 75% free
XL File size = 2 MB
Using AutoFilter via VBA, I have selected 10,000 out of 25,000 records.
I wish to delete all records with a blank in column A. In this case, 10,000 records.
The VBA code that I was using is:
Range("A1", Selection.SpecialCells(xlCellTypeLastCell)).Select
Selection.AutoFilter Field:=1, _ Criteria1:="="
Range("A2", Selection.SpecialCells(xlCellTypeLastCell)).Select
Selection.EntireRow.Delete
The deletions using VBA gave inconsistent results; sometimes all records; other
times, all but about ten records were deleted. (NOTE: If I limited the records to
about 1000, the VBA code worked perfectly and consistently!)
Therefore, I began to test things manually. This is what I found out:
When I attempted to delete Auto filtered & Selected rows manually,
XL gave the following error message:
"Microsoft Office Excel cannot create or use the data range because it is too
complex"
"Try one or more of the following:
Use data that can be selected in one contiguous rectangle
Use data from the same sheet"
What is complex about selecting rows for blanks in column A and attempting to delete
them?
NOTE: the workbook has only one worksheet!
TIA Dennis
256MB Ram
2.1 GH Intel
80G HD 75% free
XL File size = 2 MB
Using AutoFilter via VBA, I have selected 10,000 out of 25,000 records.
I wish to delete all records with a blank in column A. In this case, 10,000 records.
The VBA code that I was using is:
Range("A1", Selection.SpecialCells(xlCellTypeLastCell)).Select
Selection.AutoFilter Field:=1, _ Criteria1:="="
Range("A2", Selection.SpecialCells(xlCellTypeLastCell)).Select
Selection.EntireRow.Delete
The deletions using VBA gave inconsistent results; sometimes all records; other
times, all but about ten records were deleted. (NOTE: If I limited the records to
about 1000, the VBA code worked perfectly and consistently!)
Therefore, I began to test things manually. This is what I found out:
When I attempted to delete Auto filtered & Selected rows manually,
XL gave the following error message:
"Microsoft Office Excel cannot create or use the data range because it is too
complex"
"Try one or more of the following:
Use data that can be selected in one contiguous rectangle
Use data from the same sheet"
What is complex about selecting rows for blanks in column A and attempting to delete
them?
NOTE: the workbook has only one worksheet!
TIA Dennis