View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default COPYING ONE ROW TO ANOTHER SHEET AFTER CELL INPUT

This will go in the Worksheet code module for Sheets("ERRORS"). Right click
the sheet name tab and then select view code to open the code module window.
Paste this code into the module. This is untested. Post back if any
difficulties in running.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim lr As Long
lr = ActiveSheet.Cells(Rows.Count, 7).End(xlUp).Row
lr2 = Sheets("CODE ERROR").Rows.Count, 1).End(xlUp).Row
If Not Intersect(Target, Range("G2:G" & lr) Is Nothing Then
If LCase(Target) = "code error" Then
Target.EntireRow.Copy Sheets("CODE ERROR").Range("A" & lr2)
End If
End If
End Sub

It should copy the row if you enter "code error" in column G of
Sheets("ERRORS").





"OfficeMan" wrote:

Good Morning!

I have been trying to do this but unfortunately I am not that great with
Macros

I have sheet named ERRORS and on this sheet I have Column A:G
I have sheet name CODE ERROR and on this sheet I have Column A:G just like
the errors sheet.

I want to copy the entire ROW from sheet ERRORS to CODE ERROR each time
Column G on Sheet ERRORS has input "Code Error"

Any help would be appreciated.

Thank you.