Macro's : Cut/Paste from One Sheet to Another

wtknsphil

New Member
Joined
Sep 20, 2017
Messages
15
Hi all,

Long-time lurker now registered. Looking for a bit of help.

I did a search on here for taking a row, for example from "Sheet1" and moving it to "Sheet2". The code works in principle however on occasion it takes two rows across. The key word is "YES" in column 'i' and the macro is enabled with a button.

Could anyone advise why it sometimes takes two rows, even though I'm only putting "yes" in one row?

Thanks in advance :)

Code:
Sub Button1_Click()
     
    Application.ScreenUpdating = False
    Columns(9).AutoFilter 1, "Yes"
    With Range("a2", Range("i" & Rows.Count).End(3))
        .Copy Sheet2.Cells(Rows.Count, 1).End(3).Offset(1)
        .EntireRow.Delete
    End With
    Columns(9).AutoFilter
    Application.ScreenUpdating = True
    Selection.AutoFilter
     
End Sub
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Excellent Wtknsphil! Glad that you sorted it out.

Cheerio,
vcoolio.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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