VBA that Refreshes Workbook every five minutes and if there is a change to Data sends email

BJ2021

New Member
Joined
Oct 26, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a spreadsheet that pulls auction data through an API every Friday morning. Currently I just hit a simple vba that refreshes the workbook whenever I hit the "Refresh" tab and then it sends out a pdf through email.

I want to update the vba to automatically refresh the workbook every 5 minutes or so and if a new sale comes out (which would be reflected by a "Final" in B8-B12 and B15:B19 or by a number in C8-C12 and C15:C19) then an email would get sent out with the new sale data. But if none of the 10 sales have been released during those five minutes then the VBA just sits and refreshes again. I also want to set some criteria so that the VBA know that a sale has already been set out today so it doesn't send out again after the next 5 minute cycle. Not all of the ten sales are released each week so I also need a toggle to shut down the vba whenever I know there are no more sales for the week Friday afternoon.

I hope that makes sense. I am just really stuck on how to approach this and would really appreciate any advice anyone has. Thank you.

1666823472047.png
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I'd recommend checking out the Application.OnTime command on this forum. Others have done something similar re: the 'call a macro every X minutes' requirement.
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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