cutting and pasting row of data

eviehc123

New Member
Joined
Jan 21, 2019
Messages
32
Hi all,

Can someone help with the below?

I want to cut a row of data and paste it into a separate sheet based on the filter. Here is the code I have so far but an error appears on the highlighted line:

Rich (BB code):
Sub completecand()
Dim FilterString As String


'
     With Sheets("HR Advice & Admin")
         FilterString = Sheets("Pre-employment Clearances").Range("C4").Value
         .Range("$A$1:$AS$286").AutoFilter Field:=1, Criteria1:=FilterString
         Intersect(.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible), .Range("A:AQ")).Cut
         On Error GoTo NoVisible
         Sheets("Completed").Range("A2:A" & Rows.Count).SpecialCells(xlVisible)(1).PasteSpecial xlPasteValues
         
         On Error GoTo 0
         .AutoFilterMode = False
      End With
      Sheets("Offer Received").Select
      Application.CutCopyMode = False
      Exit Sub
NoVisible:
   Sheets("Pre-employment Clearances").Range("F4").Copy
   Sheets("Completed").Range("D" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
   Sheets("HR Advice & Admin").AutoFilterMode = False
   Sheets("Pre-employment Clearances").Select
   Application.CutCopyMode = False
End Sub

Thanks!
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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