Excel file hangs when trying to change the drop down value which has VBA script

BMD44

Board Regular
Joined
Sep 25, 2019
Messages
72
Hello All,

I have an excel file which is populating target values (Col B) for the source value (Col J) selected from the drop down. These values are for different ERPs.

The ERP is given in cell K4 (Choice_SE) field.

I have code which when selecting ERP in cell K4 from drop down, it should clear the existing values. New values will then be entered for the ERP selected in K4.

But, when I do this, the excel hangs with out clearing the data.

I think this is because of the If Not intersect code. Please suggest how can we keep if Not Intersect code in a separate function.

Thanks in advance.
 

Attachments

  • Code.PNG
    Code.PNG
    51.1 KB · Views: 7
Meanwhile, to your question, yes. Col J is a drop down for source and target is only a single which is based on the value in column J
So what is the loop trying to do? If Target is only a single cell then so is
VBA Code:
Intersect(Target, Range("J:J"))
in fact it is the same cell as Target because Target is already in Column J
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
A gentle reminder:

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,215,338
Messages
6,124,343
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top