View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Move one record to another sheet when I type in a cell

Hi,

Not too much detail but this may help. Right click the sheet tab where you
enter details of material out, view code and past this in. What it will do is
allow you to input values into any cell but as soon as you type in column E
(The return date) it will transfer the entire row the first empty row in a
sheet called "Returned" and delete the record from your input sheet. Change
column E to the one you want to initiate the change.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("E:E")) Is Nothing Then
Application.EnableEvents = False
Target.EntireRow.Copy
Lastrow = Sheets("Returned").Cells(Rows.Count, "A").End(xlUp).Row
Sheets("Returned").Range("A" & Lastrow + 1).PasteSpecial
Application.EnableEvents = True
Target.EntireRow.Delete
End If
Application.CutCopyMode = False
End Sub

Mike

"Jugglertwo" wrote:

I thought that I would go to the real gurus to get the best answer for this
one.

Ive been told that there is a way to make an entire line (record)
automatically move to another worksheet in the same workbook when you type in
a certain cell (example of how I would use it below).

I have the Lending Library to keep track of. I fill in information when
materials are sent out to keep track of who has materials out, what those
materials are and when they are due back. When the materials are returned, I
enter the date of return and then move it to the €˜returned worksheet. When I
fill in the return date, I would like to have the entire line move to the
returned spreadsheet automatically.

I assume this would be done with a macro. Would anyone be able to direct me
to a site that would help me get this macro code? I use the Macro Recorder
and know how to copy code into a modular but that is about it when it comes
to code.

Any assistance would be greatly appreciated.
Thanks!

Jugglertwo