View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ABlevins ABlevins is offline
external usenet poster
 
Posts: 4
Default Macro to copy and paste to another sheet, based on if-then-else

I need to edit an existing macro to copy and paste data from a master sheet
to one of two subsequent sheets, based on the value in a specific column (25
and lower values into cell A7 of one sheet and 26 and over into A7 of the
other). I need for the entire row of data to be copied. Any ideas?

Sub MoveA*****()
'
' MoveA***** Macro
' Copies A***** to "ALL A*****" sheet.
'

'
Selection.AutoFilter Field:=7, Criteria1:="**4**"
Range("A11").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A11:J767").Select
Selection.Copy
ActiveSheet.Previous.Select
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("K1").Select
Sheets("base").Select
ActiveWindow.LargeScroll Down:=-4
Selection.AutoFilter Field:=7, Criteria1:="**5**"
Range("G12").Select
Range(Selection, Selection.End(xlDown)).Select
Range("G12:J768").Select
Selection.Copy
ActiveSheet.Previous.Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range("O1").Select
ActiveSheet.Next.Select
Selection.End(xlUp).Select
Selection.AutoFilter Field:=7
Selection.AutoFilter Field:=11, Criteria1:="9.5"

(f-Then-Else statement here)

End Sub