Compare values in two columns and return the value from third
Closed
Wasim
-
Mar 9, 2016 at 08:02 AM
venkat1926 Posts 1864 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Mar 10, 2016 at 07:27 AM
venkat1926 Posts 1864 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Mar 10, 2016 at 07:27 AM
Related:
- Compare values in two columns and return the value from third
- Compare two worksheets and paste differences to another sheet - excel vba free download ✓ - Excel Forum
- If cell contains (multiple text criteria) then return (corresponding text criteria) ✓ - Excel Forum
- Based on the values in cells b77 b81 ✓ - Excel Forum
- Display two columns in data validation list but return only one - Guide
- Macro to compare 2 sheets and copy differences ✓ - Excel Forum
1 reply
venkat1926
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
810
Mar 10, 2016 at 07:27 AM
Mar 10, 2016 at 07:27 AM
suppose data like this
col2 col3 col4 col1
x y f t
w w x s
c t c d
d y v f
x y g u
x y y n
q w m j
e r l k
t y k l
try this macro
col2 col3 col4 col1
x y f t
w w x s
c t c d
d y v f
x y g u
x y y n
q w m j
e r l k
t y k l
try this macro
Sub test()
Dim col1, col2, ccol
Set col1 = Range(Range("A2"), Range("A2").End(xlDown))
For Each ccol In col1
If ccol = "x" And ccol.Offset(0, 1) = "y" Then
ccol.Offset(0, 3) = ccol.Offset(0, 2)
End If
Next ccol
End Sub