Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Amit
 
Posts: n/a
Default 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!


  #2   Report Post  
galimi
 
Posts: n/a
Default

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!



  #3   Report Post  
Amit
 
Posts: n/a
Default

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!





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to protect and unprotect 30 worksheets in a file every month . Protect & Unprotect Several Worksheets Excel Worksheet Functions 4 January 10th 05 01:29 PM
Protect/unprotect all worksheets Janna Excel Worksheet Functions 2 January 7th 05 01:01 AM
HELP! How do you--> Lock a set of rows but also link worksheets to FRUSTRATED Excel Discussion (Misc queries) 6 December 29th 04 10:05 PM
Assigning Cells in worksheets to other data in other worksheets. David McRitchie Excel Discussion (Misc queries) 0 November 27th 04 06:15 PM
Sort/Link Worksheets Debby Excel Worksheet Functions 0 November 12th 04 07:50 PM


All times are GMT +1. The time now is 04:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"