Cut and paste problem. I'm a newbie

ahmadzharif89

New Member
Joined
Sep 14, 2015
Messages
2
Hello everyone!

I am trying to create a button which cuts cells Bx to Fx if the cell Fx contains the word "outlier" and paste it to a different part of excel sheet. My code seems to work up to the "Cut" part but stops at the paste. It has an error on "ActiveSheet.Paste" part of the code. Please help. Here is what I have so far:

Sub Button_Click()

'Generate Outliers
Dim j, k
For j = 5 To 1050
If Cells(j, "F").Value = "OUTLIER" Then
Range(Cells(j, "B"), Cells(j, "F")).Select
Selection.Cut
End If
For k = 5 To 19
ActiveSheet.Range(Cells(k, "B"), Cells(k, "F")).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Next k
Next j

End Sub

Also, If it is possible I would actually like to paste it to a different worksheet.

THANK YOU!
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top