#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Automatic Move

I have a spreadsheet that has a column titled 'status'. Within this column I
have several status' like deferred, completed, in progress, etc. I want to
create code or something like it that will automatically move the row to
another sheet in the workbook when I change the status to complete. I do not
want the row to remain on the original sheet. I only want the information to
appear on the complete sheet.

How can I do this?

Aggie
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Automatic Move

If you are a real TEXAS aggie, since I am a "Tea Sipper", maybe I shouldn't
help but.

Right click sheet tabview codecopy/paste this.modify to suit.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 1 Then Exit Sub
On Error GoTo nono
With Sheets("destinationsheetname")
lr = .Cells(Rows.Count, "a").End(xlUp).row + 1
If UCase(Target) = "COMPLETED" Then _
Rows(Target.row).Copy Destination:=.Rows(lr)
Rows(Target.row).Delete
End With
nono:
End Sub

--
Don Guillett
SalesAid Software

"Aggie G" wrote in message
...
I have a spreadsheet that has a column titled 'status'. Within this column
I
have several status' like deferred, completed, in progress, etc. I want to
create code or something like it that will automatically move the row to
another sheet in the workbook when I change the status to complete. I do
not
want the row to remain on the original sheet. I only want the information
to
appear on the complete sheet.

How can I do this?

Aggie


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Automatic Move

Assume the first sheet (source) is called "s1"
Assume the second sheet (destination) is called "s2"
Assume the status column in s1 is column A:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("A:A"), Target) Is Nothing Then
Exit Sub
End If
If Target.Value < "complete" Then
Exit Sub
End If

Set r1 = Target.EntireRow
Set r2 = Sheets("s2").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
r1.Copy r2
Application.EnableEvents = False
r1.Delete
Application.EnableEvents = True
End Sub

This is worksheet code, it does not go in a standard module.
--
Gary''s Student - gsnu200731
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Automatic Move

I was deleting row anyway so change to

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 1 Then Exit Sub
On Error GoTo nono
With Sheets("yyy")
lr = .Cells(Rows.Count, "a").End(xlUp).row + 1
If UCase(Target) = "COMPLETED" Then
Rows(Target.row).Copy Destination:=.Rows(lr)
Rows(Target.row).Delete
End If
End With
nono:
End Sub


--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
If you are a real TEXAS aggie, since I am a "Tea Sipper", maybe I
shouldn't help but.

Right click sheet tabview codecopy/paste this.modify to suit.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 1 Then Exit Sub
On Error GoTo nono
With Sheets("destinationsheetname")
lr = .Cells(Rows.Count, "a").End(xlUp).row + 1
If UCase(Target) = "COMPLETED" Then _
Rows(Target.row).Copy Destination:=.Rows(lr)
Rows(Target.row).Delete
End With
nono:
End Sub

--
Don Guillett
SalesAid Software

"Aggie G" wrote in message
...
I have a spreadsheet that has a column titled 'status'. Within this column
I
have several status' like deferred, completed, in progress, etc. I want
to
create code or something like it that will automatically move the row to
another sheet in the workbook when I change the status to complete. I do
not
want the row to remain on the original sheet. I only want the information
to
appear on the complete sheet.

How can I do this?

Aggie



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
Automatic update of spreadsheet & automatic update between workboo Losva Excel Worksheet Functions 6 September 12th 08 03:22 PM
How do I stop making the spreadsht move when I move up/dwn/lt/rt? Manny Excel Worksheet Functions 4 April 7th 06 10:30 PM
automatic move row from sheet to another Osama Mira Excel Worksheet Functions 1 December 5th 05 06:34 PM
How do I set up an automatic delete or move of a row of data? Zo Excel Discussion (Misc queries) 4 November 24th 05 08:35 PM
When I move scroll bar in excell the contents do not move with it ramneek Excel Discussion (Misc queries) 2 June 29th 05 07:35 PM


All times are GMT +1. The time now is 11:37 PM.

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"