![]() |
moving a row between worksheets
I want to write VBA code that does the following: When a value in column E
is changed to "John" that entire row is moved to a worksheet (in the same spreadsheet) called "Assigned". Is this possible? Thanks! |
Amit,
I've uploaded the file with code to http://Galimi.com/Examples/MS.xls Following is the code to be embedded as a Change event on the sheet that recognizes the word John: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 5 Then If Target.Value = "John" Then 'Move the column to the Assigned sheet Rows(Target.Row).Copy shtAssigned.Rows(shtAssigned.UsedRange.Rows.Count + 1) End If End If End Sub http://HelpExcel.com "Amit" wrote: I want to write VBA code that does the following: When a value in column E is changed to "John" that entire row is moved to a worksheet (in the same spreadsheet) called "Assigned". Is this possible? Thanks! |
This is awesome, thanks Galimi!
"galimi" wrote in message ... Amit, I've uploaded the file with code to http://Galimi.com/Examples/MS.xls Following is the code to be embedded as a Change event on the sheet that recognizes the word John: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 5 Then If Target.Value = "John" Then 'Move the column to the Assigned sheet Rows(Target.Row).Copy shtAssigned.Rows(shtAssigned.UsedRange.Rows.Count + 1) End If End If End Sub http://HelpExcel.com "Amit" wrote: I want to write VBA code that does the following: When a value in column E is changed to "John" that entire row is moved to a worksheet (in the same spreadsheet) called "Assigned". Is this possible? Thanks! |
All times are GMT +1. The time now is 10:42 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com