View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Move Row if cell is not null

This code is untested. You will need to change the range
parameters for the remove column to the actual column that
you intend to use. You will also have to change the
destination sheet name to your actual sheet. Place the code
in the Sheet code module for the sheet that you want the
data copied from. To access the code module, right click the
sheet tab and click "View Code" in the drop down menu.


Private Sub Worksheet_Change(ByVal Target As Range)
Set Remove = Range("C2:C100") '<<<Change to suit
If Not Intersect(Target, Remove) Is Nothing Then
If Targget < "" And Target.DataType = xlDate Then
Target.EntireRow.Copy Sheets("Destination") _ '<<<Change
.Range("A" & Range("A65536").End(xlUP).Row + 1)
End If
End If
End Sub

The code is activated by a change to the worksheet. It will only
copy the data if the change is in a cell in the designated column
and the data in the target cell is a date. If the criteria is met,
the row on which the change is made will be copied to the next
available row on the destination sheet.


"JayM" wrote:

Is it possible to use code or functions of some sort to move an entire row to
another sheet if one cell in that row is not null.

For example I have a list of users in a sheet and when they are removed from
the system i want to move them onto another row my criteria for moving them
would be to add a date in the column called Removed.

Hope this makes some sort of sense.

Any help would be greatly appreciated.

JayM - Newbie