Macros running beside each other taking same data.

ScotlandsNeo

New Member
Joined
Nov 12, 2015
Messages
10
Hi,

I have an issue where I created a workload distribution tool in excel that quite simply, when you click "next case" (button that has macro assigned) it cuts the data from another workbook where a table of cases are sitting ready to be worked.

The problem I have is that when 2 people have the workload tool open and run the macro by clicking "next case", the macro's both run and take the same data simultaneously. This is an issue as it means 2 people (or more) could be working the same cases, how can I stop this from happening?

Regards,
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi ScotlandsNeo

Can I suggest that you create a flag in the cases worksheet to indicate that the case has been picked up.
Then the first thing your macro does is check the flag and if missing (false/0), write (True/1) that it's been picked up.
It's unlikely that both macros will be run at the same split second, so there shouldn't be a conflict anymore.

Do you think that would work?

Regards
 
Upvote 0
Hi ScotlandsNeo

Can I suggest that you create a flag in the cases worksheet to indicate that the case has been picked up.
Then the first thing your macro does is check the flag and if missing (false/0), write (True/1) that it's been picked up.
It's unlikely that both macros will be run at the same split second, so there shouldn't be a conflict anymore.

Do you think that would work?

Regards

Thanks for this, before I left the office I came up with a system of having the raw data filtered for a username, and copied the 1st row across to the user's tool to be worked, it also removes the name and logs their environment username instead so that the next time they run the macro it avoids that row and they respectively take the newest case to them. Effectively using the same concept as your flag idea but with usernames :)
 
Upvote 0

Forum statistics

Threads
1,215,972
Messages
6,128,027
Members
449,414
Latest member
sameri

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