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
- Excel run macro on open - Guide
- Run macro when cell value changes by formula - Guide
- Excel online macro - Guide
- Insert last modified date in excel cell without macro ✓ - Excel Forum
- What function can automatically return the value in cell c77 ✓ - Excel Forum
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