Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to copy and paste based on a condition | Excel Discussion (Misc queries) | |||
Copy from one Sheet and paste on another sheet based on condition | Excel Discussion (Misc queries) | |||
Finding a named range based on cell value and copy/paste to same sheet? | Excel Programming | |||
copy and paste to another sheet based in cell color | Excel Programming | |||
Macro Syntax to copy and paste dynamic data based on one column | Excel Programming |