Hi
I have copied the following code from a previous workbook but want to apply the same macro on a new workbook (they are not to be linked).
The trouble is - it doesn't work.
Can some one help and if possible I need it to search in column I not Column E.
Sub Invoicing()
Dim c_ell As Range, Sh_Invoiced As Worksheet, Sh_Snagging As Worksheet, Sh_projects As Worksheet
Dim Rng_copy As Range
On Error GoTo E_rror
Set Sh_projects = ActiveSheet
Set Sh_Invoiced = Sheets("Invoiced")
Set Sh_Snagging = Sheets("Snagging")
For Each c_ell In Range("E4", Cells(Rows.Count, 5).End(xlUp))
If c_ell.Offset(0, 6) = "Yes" Then
If Rng_copy Is Nothing Then
Set Rng_copy = c_ell.EntireRow
Else
Set Rng_copy = Union(Rng_copy, c_ell.EntireRow)
End If
End If
Next
If Rng_copy Is Nothing Then Exit Sub
Application.CutCopyMode = False
Rng_copy.Select
Selection.Copy
Sh_Invoiced.Select
Cells(Rows.Count, 5).End(xlUp).Offset(1, -4).PasteSpecial
Cells(4, 1).Select
Sh_projects.Activate
Rng_copy.Select
Selection.Delete Shift:=xlUp
Cells(4, 1).Select
Exit Sub
E_rror:
MsgBox "AN error occured", vbOKOnly, "ERROR IN PROCESS"
End Sub
Bookmarks