Trying to filter a few numbers from a larger group of numbers in one cell, copy them, then paste them in another cell. Error comes up as "Runtime error '1004': Paste special Method of Range class fail". When I go to "debug", it shows this:
[image: copy to clipboard] Sub Macro1() ' ' Macro1 Macro ' averages ' ' Keyboard Shortcut: Ctrl+m ' Range("F4:F16").Select Selection.ClearContents ActiveSheet.Range("$A$1:$E$279").AutoFilter Field:=1, Criteria1:=RGB(198, _ 239, 206), Operator:=xlFilterCellColor Range("A8:A239").Select Selection.Copy ActiveSheet.Range("$A$1:$E$279").AutoFilter Field:=1 Range("F4:F15").Select ActiveSheet.Paste End Sub How can I get my macro to cut and paste what I want without this error? This is exactly how I tried to create my macro: Selected "View tab" Selected "Record Macro" tab (use relative references tab not highlighted) Macro name: Macro1 Short cut Key: Ctrl + "m" Store macro in: this workbook Select f4-f16 right click and select clear contents click on filter tab in column "A" select filter by color select green select "a8-a239" right click and select "copy" click on filter tab in column "A" select clear filter from "column A" select f4-f16 right click and select "paste" click on stop button to stop recording macro. Then to run macro I: view macros select macro1 click on "run" Then it executes everything I did in my macro EXCEPT "paste" at the end. That's when I get the run-time error code '1004' paste special method of worksheet class failed. It seems to me I did everything right but it didn't work. -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.