ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to copy and paste to another sheet, based on if-then-else (https://www.excelbanter.com/excel-programming/411165-macro-copy-paste-another-sheet-based-if-then-else.html)

ABlevins

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


All times are GMT +1. The time now is 06:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com