L
L. Howard
If I change this code (by Claus in a recent post):
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
Dim arrOut As Variant
If Intersect(Target, Sh.Range("F:F")) Is Nothing Or Sh.Name _
= "Shipped" Or Target.Count > 1 Then Exit Sub
With Target
If .Value = "Shipped" Then
arrOut = Range(Cells(.Row, 1), Cells(.Row, 7))
Sheets("Shipped").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) _
.Resize(1, 7) = arrOut
Rows(.Row).Delete
End If
End With
End Sub
To this, so as NOT to have an Event Macro:
Sub Array_Out()
Dim arrOut As Variant
Dim c As Range
For Each c In Range("F:F")
If c.Value = "This" Then
arrOut = Range(Cells(c.Row, 1), Cells(c.Row, 7))
Sheets("Shipped").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) _
.Resize(1, 7) = arrOut
'Rows(.Row).Delete
End If
Next
End Sub
Did I ruin the whole concept of the arrOut by doing a For Each c In Range("F:F")?
It works, and is fast, but it is dealing with a small amount of data.
Thanks,
Howard
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
Dim arrOut As Variant
If Intersect(Target, Sh.Range("F:F")) Is Nothing Or Sh.Name _
= "Shipped" Or Target.Count > 1 Then Exit Sub
With Target
If .Value = "Shipped" Then
arrOut = Range(Cells(.Row, 1), Cells(.Row, 7))
Sheets("Shipped").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) _
.Resize(1, 7) = arrOut
Rows(.Row).Delete
End If
End With
End Sub
To this, so as NOT to have an Event Macro:
Sub Array_Out()
Dim arrOut As Variant
Dim c As Range
For Each c In Range("F:F")
If c.Value = "This" Then
arrOut = Range(Cells(c.Row, 1), Cells(c.Row, 7))
Sheets("Shipped").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) _
.Resize(1, 7) = arrOut
'Rows(.Row).Delete
End If
Next
End Sub
Did I ruin the whole concept of the arrOut by doing a For Each c In Range("F:F")?
It works, and is fast, but it is dealing with a small amount of data.
Thanks,
Howard