GoTo Function in VBA checking values

blimey88

New Member
Joined
Aug 20, 2019
Messages
38
Can anyone help with the following, I am trying to miss the email module when checking through my code,

I want the to skip this part of the code:

Call EmailOutOfDate (Email, ExpDate, Documents, Days Remaining) and check a value in the cell which determines whether or not an email should be sent. I need to completely skip this but return to it if the email is required to be sent.

I hope this makes sense if it doesn't but you think you can help please let me know.
 
This part of the code is checking the email time frame and will mark cell with the relevant amount of days 60,30,15,0 what I need it to do is then see that the 60 day email has been sent and not send it again. The 60 day marker will then count down to 30 and then send the 30 day email, I don’t want it to send another 60 day email
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I'm now totally confused.
Which cell is used to show that an email has been sent & which cell shows when it was sent (ie 60 days, 30 days etc)
 
Upvote 0
Ok, I have an expiry date in cell F4 and in G4 I need to mark that an email has been sent at 60 days, I then need to code to check that the 60 day email has been sent and to ensure that a duplicate email isn’t sent. I then need it to send another email at 30 days and mark it accordingly and then another at 15 days and then at 0 days. My issue is that when I run the code it sees the 60 day marker and then wants to send another 60 day email reminder?
 
Upvote 0
Check to see if G4 says 60, if it does, don't sent the email unless you are at the 30 day mark.

Please remember that I have no idea what your data is like, where it is, or what you are trying to do.
Also your code is almost impossible to understand due (in part) to the use of ActiveCell as I have no way of knowing what the cell is.
 
Upvote 0
Yes that’s it. I know I completely understand that your working blind and off my not so good explanations. All the help is hugely appreciated. But yes that’s what I’m after.
 
Upvote 0
How about
Code:
   Select Case DaysRemaining
      Case 60, 30, 15
         If Range("G4").Value <> DaysRemaining Then
            Call EmailOutOfDate(Email, ExpDate, Documents, DaysRemaining)
            Range("G4").Value = DaysRemaining
         End If
   End Select
 
Upvote 0
I added the code and have played around with it a little more and it’s working and no longer duplicating. Many thanks for all the help It was hugely helpful and massively appreciated ?
 
Upvote 0
Glad to hear you sorted it & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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