Hi Chris,
Right click on sheet1, select View Code and paste the following. It
will copy the row from sheet1 to sheet2 whenever you put the word order
in column g.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 Then
For Each cell In Target
If UCase(cell.Value) = "ORDER" Then
Dim ws As Worksheet
Dim NextRow As Long
Set ws = Sheets("sheet2")
With ws
NextRow = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
End With
cell.EntireRow.Copy Destination:=ws.Cells(NextRow, 1)
Set ws = Nothing
End If
Next
End If
End Sub
Regards,
Linda
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Chris Thompson
Sent: Thursday, September 09, 2010 11:06 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Off-Topic - Excel VBA to Copy Entire Row to New Tab
based on Cell Value
Hi All
Does anyone know any VBAScript which will copy an entire row in Sheet 1
to the
next available row in Sheet 2 based on a cell value in column G.
So if G6 = Order then copy the entire row and paste in the next avilable
row on
Sheet 2.
I have tried a few I have found on Google, but none of them seem to work
when I
try them.
It is as if the macros are disabled - but I can't find how to enable
them in
Excel.
Thanks.
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
Right click on sheet1, select View Code and paste the following. It
will copy the row from sheet1 to sheet2 whenever you put the word order
in column g.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 Then
For Each cell In Target
If UCase(cell.Value) = "ORDER" Then
Dim ws As Worksheet
Dim NextRow As Long
Set ws = Sheets("sheet2")
With ws
NextRow = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
End With
cell.EntireRow.Copy Destination:=ws.Cells(NextRow, 1)
Set ws = Nothing
End If
Next
End If
End Sub
Regards,
Linda
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Chris Thompson
Sent: Thursday, September 09, 2010 11:06 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Off-Topic - Excel VBA to Copy Entire Row to New Tab
based on Cell Value
Hi All
Does anyone know any VBAScript which will copy an entire row in Sheet 1
to the
next available row in Sheet 2 based on a cell value in column G.
So if G6 = Order then copy the entire row and paste in the next avilable
row on
Sheet 2.
I have tried a few I have found on Google, but none of them seem to work
when I
try them.
It is as if the macros are disabled - but I can't find how to enable
them in
Excel.
Thanks.
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]