Range not entire row

Garouken

New Member
Joined
Feb 21, 2017
Messages
7
I currently am using the following code to cut and paste a row of information to a different tab based upon if the value "x" is in a cell.
it works great but i want to change it so that it only copies the first 11 rows not the entire row (so A to K).

This is the working code
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    '   Code goes in the Worksheet specific module
    Dim rng As Range
        '   Set Target Range
        Set rng = Target.Parent.Range("K2:K200")
             '   Only look at single cell changes
            If Target.Count > 1 Then Exit Sub
            '   Only look at that range
            If Intersect(Target, rng) Is Nothing Then Exit Sub
            '   Action if Condition(s) are met
            Select Case Target.Text
                Case "x"
                    Target.EntireRow.Cut Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(1)
                Case Is = ""
                    Target.EntireRow.Cut Sheets("Monitoring").Cells(Rows.Count, "A").End(xlUp).Offset(1)
            End Select
End Sub


Any help is much apreciated
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,215,523
Messages
6,125,315
Members
449,218
Latest member
Excel Master

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