If function understanding
Moderators: Dorian (MJT support), JRL
If function understanding
Hi, I'm new to my Macro scheduler and I need to use the function if. I need the function to check two values. that failures will come from a website and excel and I need to check if they are the same. if they are I want the function to stop the macro and if they are not I needed to continue the macro. Can you give me example
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: If function understanding
To compare two variables and exit the script if they are not the same, you'd do something like this :
You can see an in-depth description of IF here.
Code: Select all
if>%variable1%<>%variable2%
exit
endif
Yes, we have a Custom Scripting Service. Message me or go here
- Grovkillen
- Automation Wizard
- Posts: 1131
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: If function understanding
And this is also valid:
Code: Select all
ifnot>%variable1%=%variable2%
exit
endif
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: If function understanding
You know.... I don't think I've ever used that in the 25 years I've been using MS (IfNot probably hasn't existed for 25 years)...
In fact it slipped my mind that it even existed.
In fact it slipped my mind that it even existed.
Yes, we have a Custom Scripting Service. Message me or go here
Re: If function understanding
ok, how do I import the external data to the variables/code so we can control it.
Imagine I want scrape data from a website but I need to know if that was already been scraped. I have list it all the links that had been scraped and I want compare the last link of list with link I am trying to scrape.
The examples provided in your library, already got the value of the variable in the code...
Did I explain the problem successfully
Imagine I want scrape data from a website but I need to know if that was already been scraped. I have list it all the links that had been scraped and I want compare the last link of list with link I am trying to scrape.
The examples provided in your library, already got the value of the variable in the code...
Did I explain the problem successfully
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: If function understanding
What you want to do is quite complex for a beginner. You'll need to master and fully understand the techniques linked below before you should even think about putting it all together into something resembling your "end product". Learn and test each stage/element. Make sure you can walk before you try to run.
Reading from Excel.
For "scraping" pages
Reading from Excel.
For "scraping" pages
Yes, we have a Custom Scripting Service. Message me or go here
Re: If function understanding
I just need the function to bring the data from the "selected copy"(CTRL + C) to the code.. so I can build the condition for the function IF.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: If function understanding
Yes, we have a Custom Scripting Service. Message me or go here
Re: If function understanding
special thanks!!