Hi Ron,
You have really thrown me now. I created a test workbook just as I did
yesterday with the intention of sending it to you and it all works as you say
it should. Unfortunately I didn't save the test that I used yesterday.
I assure you that I am not telling porkies when I said yesterday that it
copied all cells and the crawling ants were around the outer perimeter of the
selection only.
Selecting the range and then Find & Select->Goto Special->Visible cells only
prior to copy worked.
Because you tell me that more people report problems I now think that there
may be a bug that raises it ugly head intermittently. Just to add a little to
my history of this, I originally believed that it only copied the visible
cells until one day back when I only had xl2002 I experienced a problem where
it copied all the cells. I decided at the time that I must be mistaken in my
belief that it only copied the visible cells and ever since I have always
used the Special Cells->Visible method. With this latest episode I think that
the bug was around pre xl2007.
The test worksheet that I created had random data so that the filtered rows
were not consecutive. The following is a copy of a recorded macro which
demonstrates how I created the worksheet.
If I come across the problem again then I will certainly forward it to you.
Sub Macro1()
'Recorded macro to create test data for AutoFilter
Sheets("Sheet1").Select
Range("A1").Select
ActiveCell.FormulaR1C1 = "Col Head 1"
Selection.AutoFill Destination:=Range("A1:F1"), _
Type:=xlFillDefault
Range("A1:F1").Select
Range("A2").Select
ActiveCell.FormulaR1C1 = "=RANDBETWEEN(0,10)"
Selection.AutoFill Destination:=Range("A2:F2"), _
Type:=xlFillDefault
Range("A2:F2").Select
Selection.AutoFill Destination:=Range("A2:F101"), _
Type:=xlFillDefault
Range("A2:F101").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.AutoFilter
Range("A1:F1").Select
Selection.Font.Bold = True
Columns("A:F").Select
Selection.Columns.AutoFit
Range("A2").Select
End Sub
Regards,
OssieMac