Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to copy and paste based on a condition kathryn462 Excel Discussion (Misc queries) 5 October 14th 08 12:59 AM
Copy from one Sheet and paste on another sheet based on condition Prem Excel Discussion (Misc queries) 2 December 24th 07 05:05 AM
Finding a named range based on cell value and copy/paste to same sheet? Simon Lloyd[_715_] Excel Programming 1 May 11th 06 11:25 PM
copy and paste to another sheet based in cell color nat3ten Excel Programming 7 July 8th 05 11:14 PM
Macro Syntax to copy and paste dynamic data based on one column jbsand1001 Excel Programming 0 May 17th 05 02:49 PM


All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"