Hi everyone,
I need some help with this problem:
I need copy the cells in column D and E, if in the column B have and X or x, from one sheet to another, starting in the cell E7.
I create this code but… well, I give up.
Sub Exp()
Dim LPr As Integer
Dim LCp As Integer
On Error GoTo Err_Execute
Sheets("Desp").Activate
LPr = 3
LCp = 3
While Len(Range("E" & LPr).Value) <> ""
If Range("B" & LPr).Value = "X" _
Or Range("B" & LPr).Value = "x" Then
Range("B" & LPr).Offset(0, 2).Copy _
Destination:=Sheets("Tabl").Range("E7").End(xlDown).Offset(0, 1)
' Range("B" & LPr).Offset(0, 3).Copy _
Destination:=Sheets("Tabl").Range("F7").End(xlDown).Offset(0, 1)
LCp = LCp + 1
ElseIf Range("B" & LPr).Value = "" Then
LCp = LCp + 1
End If
LPr = LPr + 1
Wend
Application.CutCopyMode = False
Err_Execute:
Exit Sub
End Sub
Any help would be appreciated.
Thanks in advance.
Bookmarks