I have to trigger one of two macros depending on the value of a cell. Here is what I have so far.
no matter what the value is in A4, it triggers notify1.Please Login or Register to view this content.
I have to trigger one of two macros depending on the value of a cell. Here is what I have so far.
no matter what the value is in A4, it triggers notify1.Please Login or Register to view this content.
Last edited by drflgd; 10-30-2017 at 03:48 PM.
Indeed strange.
To answer properly:
1) Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
2) Will you please attach a SMALL sample Excel workbook(s) ? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).
1. Make sure that your sample data are truly REPRESENTATIVE of your real data. (If trere are typical cases like: all unique values/duplicates could occur, day/night, nobody present/several persons at once, before/on/past due, etc. - please show them all or at least indicate in text) The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.
2. Make sure that your desired solution(s) is/are also shown (mock up the results manually).
3. Make sure that all confidential/restricted information (either personal or business) like real e-mails, social security numbers, bank accounts, etc. is removed first!!
To attach an Excel file you have to do the following: Just before posting, scroll down and press Go Advanced button and then scroll down and press Manage Attachments link. Now follow the instructions at the top of that pop-up screen.
3) MAy be your data is not number? Or may be it's just text which looks like a number?
4) if there are just 2 options there is no need to use elseif. Else would be enough.
Best Regards,
Kaper
I tried your modification and it did the same thing.
I tried a different way with the same results.
The logic you shared should work @Kaper. The above code should too. The Call to notify(1,2,3) is just variations of Ron de Bruin's Outlook code which can be found by googling his name (and excel outlook vba email). His code works fine when I trigger it manually. Just can figure out how to trigger it based on the greater/less then criteria. Is there another syntax that might work?Please Login or Register to view this content.
I attached a graphic of my logic as a reference
I read what you said the first time... but it just didn't click! @Kaper, you are right. A2 was a percentage. All I needed to do was convert my field from a percentage and it worked (or change the code with a simple decimal).
It's the simple things that stump me the most! Duh, that was simple.
Thanks for the help
So indeed, I feel like a prophet :-) keeping saying:Would be lovely if you mark thread SOLVED (above your first post you can find Thread Tools to do so.Attach a sample workbook
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks