Move entries from one sheet to another

NewToTheWorld

New Member
Joined
Mar 25, 2022
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hey folks,

Looking to see if you guys can help me get this figured out, I'm hoping that there is a way to get data that is entered on one sheet to automatically move to another sheet based on a Yes/No in a column.

Screenshot below, if column O = Yes, then move the data from A through N to the sheet titled "master" which is identical looking to this sheet. Then I'm assuming I duplicate this for all of the other sheets below also?

1648227617661.png
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Please describe step by step how and what you are copying and how you are pasting the data. It would be easier to help if you could upload a copy of your file to a file sharing site and post a link to the file here.
 
Upvote 0
Hi Mumps
I have a similar issue. When you get time, can you have a look at it ?
 
Upvote 0
Replace the previous code with the following:
VBA Code:
Dim x As Long
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    x = Target.Row
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    Dim rng As Range
    For Each rng In Target
        Select Case Range("B" & x).Value
            Case "300"
                With Sheets("San Jose")
                    Rows(x).EntireRow.Copy .Cells(.Rows.Count, "A").End(xlUp).Offset(1)
                End With
            Case "302"
                With Sheets("Sacramento")
                    Rows(x).EntireRow.Copy .Cells(.Rows.Count, "A").End(xlUp).Offset(1)
                End With
            Case "303"
                With Sheets("Fresno")
                    Rows(x).EntireRow.Copy .Cells(.Rows.Count, "A").End(xlUp).Offset(1)
                End With
            Case "310"
                With Sheets("Reno")
                    Rows(x).EntireRow.Copy .Cells(.Rows.Count, "A").End(xlUp).Offset(1)
                End With
            Case "312"
                With Sheets("North Bay")
                    Rows(x).EntireRow.Copy .Cells(.Rows.Count, "A").End(xlUp).Offset(1)
                End With
        End Select
        x = x + 1
    Next rng
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
I tested the macro on the file you posted and it worked properly. Make sure that you have copied/pasted all the lines of code including the first line:
VBA Code:
Dim x As Long
which should be at the very top of all the code above this line:
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If it still doesn't work, please upload the file you take the data from again.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,645
Messages
6,120,711
Members
448,984
Latest member
foxpro

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