Thread: Copy command
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jentan Jentan is offline
external usenet poster
 
Posts: 13
Default Copy command

Hi,

I needed help on the command below. I try to copy(based on the
selection criteria below) from tab A to tab "Staff" with with the
command below. However, the macro hang when I try to refresh it.
Please assist. Thank you.

Sub Macro1()
Selection.AutoFilter Field:=4, Criteria1:="=04*", Operator:=xlAnd
Dim lastrow As Long
lastrow = ActiveSheet.UsedRange.Rows.Count
For i = lastrow To 1


Rows("i").Select
Selection.Copy
Sheets("Staff").Select
ActiveSheet.Paste
End Sub