Hi There,
In coloumn D i have a data validation list (N,Y,NA). If "N" is selected I want the entire row to move to the worksheet called "Declined Referrals".
How can i do this?
Many thanks
Jess
Hi There,
In coloumn D i have a data validation list (N,Y,NA). If "N" is selected I want the entire row to move to the worksheet called "Declined Referrals".
How can i do this?
Many thanks
Jess
Hi Jess. Try:![]()
Please Login or Register to view this content.
You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
Practice makes perfect. I'm very far from perfect so I'm still practising.
Hi there,
Thank you for your quick response. Doesn't seem to work though :/
Maybe:
![]()
Please Login or Register to view this content.
That worked great, thank you. Is there a way to remove it from the original worksheet once it has been copied to the 'Declined Referrals'.
Many thanks
Jess
Maybe:
![]()
Please Login or Register to view this content.
Brilliant, thank you![]()
Sorry spoke too soon. It is showing run-time error '13' - Type mismatch. When i press debug it is highlighting "If Target.Value = "N" Then
Change too: If Target.Text = "N"
Hi,
What does the End(3)(2) do? Only I have copied the code to use in a new spreadsheet and it has come up with run-time error 9. This is teh new code
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns(13)) Is Nothing Then
If Target.Text = "Blue" Then
Rows(Target.Row).Copy Sheets("Embedded as Business as Usual").Range("A" & Rows.Count).End(3)(2)
Rows(Target.Row).Delete
End If
End If
End Sub
It places the copied row on the destination sheet to the first in ununsed cell in Column A. Check your destination Sheets name. Spelling, spaces ect.
*blushes* whooops you were right.
sorry and thank you
Sorry me again, I've noticed an actual probem this time. When it is transferring to the next worksheet it is deleting the row that was there before instead of adding it underneath
Can you attach a sample where that is occuring? It shouldn't overwrite anything.
EAU3_Patient_Status_2014.xlsm
Thank you
Umm. You have merged cells in your sheets, which can cause problems. Can something like this help?
![]()
Please Login or Register to view this content.
Sorry, it's still deleting rows
This one is working for me on the sample provided?
I also changed this:![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
It's very strange as it was working perfectly before. I'll attach my one again.
Try it now.
Sorry it's still doing it but this time with run-time error '1004': method 'intersect of object_global'failed. Could it be my computer because it used to work fine?
Thank you
I dunno. It works on mine?
I've worked it out, it's happening when A1 is blank on the previously copied across row, so it thinks teh whole row is blank and pastes over it. Can we ask it to check if column B is empty?
Many thanks
Jess
I'm not sure what you mean? The code provided is relative too what's in Column D not A or B, because on your spreadsheets Columns A,B and C are merged.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks