View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
vbjenny vbjenny is offline
external usenet poster
 
Posts: 3
Default VBA error in Excel 2003

I did a little more testing and have come to the following conclusion:

Sub test()
Sheets("Sheet1").Range("A1").CurrentRegion.Copy _
Sheets("Sheet2").Range("A1")
End Sub

the above code worked for several years in previous versions of Excel
but produces errors in Excel 2003. The errors occur when the data is
filtered and the data to be copied is made op of non-contiguous rows.

Example:

1. after filtering you want to copy rows 1,5,8,13,23 then there is an
error message

2. after filtering you want to copy rows 1,2,3,4,5,6 then the code
runs fine (NO ERROR)


thanks, Jenny