call a Macro based on intersection

NickYOW

New Member
Joined
Mar 5, 2021
Messages
24
Office Version
  1. 2010
Platform
  1. Windows
I am trying to call a macro based on a cell with cross reference to task and Position. Currently I am using
IF range("C4").value = "Add" then
call cashierwashadd
else
call cashierwashremove
end if
if range("D4").value ="Add" then
call supervisorwashadd
else
call supervisorwashremove
end if
1615569680680.png

but the Problem is if I add a Task then C4 is no longer addressed with wash and all my code would have to be change.

I need some code that say if active cell is in column(cashier) and in row(wash) then call cashierwashadd else cashierwashremove & would move with it if the case was cashier wash was to move to cell C5.

any help would be great thanks in advance.
 
That suggests that you have a space after "wash" in the cell, best option would be to edit the cell to get rid of the space.
thanks this has been amazing. you have been a great help..
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Glad to help & thanks for the feedback.
 
Upvote 0
Glad to help & thanks for the feedback.
You have been such a great help and I am now trying to simply my code once again.

The macro that I have now is that if F5 is set to Add then RUN managerstockadd.

within that code it states to have F7 & F8 become optional and a msgbox" do you want to add optional jobs" and F16 Becomes Required, but this is many many lines of code, and again if I add a row above F5 in then the code within the macro become incorrect as F7 will not be sweep floor anymore.
1615666008888.png

I was thing about an offset code though not sure that would work. I'm think a look up verification table would work better.
1615668092777.png


I'm reaching out again as you have been a great help and my code has worked but updating it and changing all the cell reference will take too much time and the code your have been providing is been very helpful. I'm some what new to VBA and have been doing things the long way.
 

Attachments

  • 1615666322573.png
    1615666322573.png
    6.1 KB · Views: 0
Upvote 0
We would need to see the code in order to help, but as this is a totally different question to your op, it needs a new thread. Thanks
 
Upvote 0
We would need to see the code in order to help, but as this is a totally different question to your op, it needs a new thread. Thanks
thank you for the info I have done so, title is Link tasks to profiles within a macro, and I have included some of the code. you long with other have been a great help I am happy to have found this group of people.
 
Upvote 0

Forum statistics

Threads
1,215,040
Messages
6,122,806
Members
449,095
Latest member
m_smith_solihull

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