Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-17-2019, 07:36 AM
limsp limsp is offline Need help to create macro to find and replace if conditions are met Windows 10 Need help to create macro to find and replace if conditions are met Office 2016
Novice
Need help to create macro to find and replace if conditions are met
 
Join Date: Apr 2019
Posts: 1
limsp is on a distinguished road
Default Need help to create macro to find and replace if conditions are met

I need some help in creating vba/macro to find and replace if conditions are met.

PHP Code:
Col_A        Col_B        Col_C
aa            Depa        Depb
bb            Depa        Depc
bb            Depb        Depi
cc            Depc        Depj
cc            Depd        Depk
aa            Depc
aa            Deph
aa            Depj 

Condiitions:
1. If any value in column b match any of the list in column C
2. and column a is "aa",


3. then replace "aa" with "yy"


Thanks very much for the help.
Reply With Quote
  #2  
Old 04-19-2019, 06:45 AM
p45cal's Avatar
p45cal p45cal is online now Need help to create macro to find and replace if conditions are met Windows 10 Need help to create macro to find and replace if conditions are met Office 2016
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

Do you need a macro?
In row 2 of any column beyond column C:
Code:
=IF(AND(A2="aa",ISNUMBER(MATCH(B2,$C$1:$C$5,0))),"yy",A2)
copy down.

Then copy|paste-special values over column A.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace Macro Need djpemberton Word VBA 2 05-04-2016 07:53 PM
Looking for code to create a macro that prompts user to enter text, then does a find/replace. sfvegas PowerPoint 0 01-08-2016 02:22 AM
Need help to create macro to find and replace if conditions are met Find and Replace Macro amparete13 PowerPoint 3 03-11-2014 05:29 AM
macro or find/replace JamesVenhaus Word 2 02-27-2012 03:34 PM
Find and Replace Macro - A Better Way Tribos Word VBA 0 10-08-2008 03:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:38 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft