We help IT Professionals succeed at work.
Get Started

VBA: Find and replace based on value of cell

33 Views
Last Modified: 2020-09-28
I am trying to find and replace data within a cell based on the value of a cell in a different column.

This is a 3 part update:

Step 1 - Look through column B for one of the agent IDs listed in the macro  (It would need to look for multiple values)
Step 2 - If there is a match to the listed Agent ID, replace the value in column L with X (this would also be stored in the macro as one value)
Step 3 - If there was a change made to column L, change the value in column A to "Y"

Hopefully this makes sense. It would then be stored to my personal macros. So when I export the user file for our phone system, I can make the changes and then upload it back into the phone system for quick updates to the agent skills.

I attached a sample file of what I export.

Here is the list of agent IDs (Column B) it will need to look for:

15344995
15345008
15344996
15393269

Here is the value that would need to replace the current data in column L:

4349850|3;4349892|2;4349893|1

I can do a basic find and replace macro but do not know how to make it based on the value of another cell.

Any help you can provide will be much appreciated!
Comment
Watch Question
Mechanical Engineer
CERTIFIED EXPERT
Distinguished Expert 2020
Commented:
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE