Copy and past the not equal value using macro
Solved/Closed
ctran123
Posts
2
Registration date
Wednesday January 21, 2015
Status
Member
Last seen
March 3, 2015
-
Updated on Nov 12, 2018 at 12:52 AM
Sam - Jul 10, 2017 at 08:36 AM
Sam - Jul 10, 2017 at 08:36 AM
Related:
- Run macro if cell value equals
- If cell contains date then return value - Excel Forum
- Conditional formatting if cell contains text - Excel Forum
- Based on the values in cells b77:b81, what function can automatically return the value in cell c77? ✓ - Excel Forum
- Count if cell contains number - Excel Forum
- Excel macro to create new sheet based on value in cells - Guide
1 response
Thanks for the sample code it really helps.
I made a few changes for you.
I made a few changes for you.
Sub runme2()
Dim lRow As Long, lastRowE As Long
Sheets("Sheet1").Select
lRow = Sheets("Sheet1").Range("C" & Rows.Count).End(xlUp).Row
lastRowE = Sheets("Sheet2").Range("E" & Rows.Count).End(xlUp).Row
For Each cell In Range("C2:C" & lRow)
On Error GoTo docopy
r = Rows(Application.Match(cell.Value, Sheets("Sheet2").Range("E1:E" & lastRowE), 0)).Row
Next
Exit Sub
docopy:
cell.EntireRow.Copy Sheets("Sheet3").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
Resume Next
End Sub
Jan 21, 2015 at 08:05 PM
it works perfectly !!!!
Jul 10, 2017 at 08:36 AM