Good morning VBA masters.
Let me start off by saying I am not a VB expert by any means. I am getting
a bit better with modifying small things here and there, but I am
absolutely lost when it comes to writing code from scratch. That being
said, I have a code that works fine, but I am trying to add some
functionality to it. I have an Excel spreadsheet that has Holidays
listed. What I am looking to do is possibly use a vllokup to compare
today's date to the range of dates in the holiday tab. If it is an error
(not matching) then it should move on to the next check, which is a cell
that the user can manually select yes or no in order to continue the code.
If it finds a match (today is a holiday), then it should stop running at
that point and do nothing else.
I found a bit of code online. I have been trying to get it to work as I
describe above, but I am not sure how to exactly get it working correctly.
Specifically, I do not know how to get the code to stop, or if my little
intermediate If statement is done correctly, if my VLookup statement is
written correctly, or if the code makes any sense at all! This is what I
have so far:
'--- Compare today's date to dates in holiday tab
Worksheets("Holidays").Activate
strFound = Application.WorksheetFunction.VLookup(.Range("D2"),
.Range("B2:B100"), 1, 0)
If IsError(strFound) Then
'--- Check to see if emails are manually turned off
Worksheets("Daily_Email").Activate
If .Range("F2") = "NO" Then
End Sub
Else
'(I am guessing I can then copy in all of my working code here)
End If
Else
End If
End Sub
Can someone please give me a little helping hand with getting this written
correctly? I would greatly appreciate any help that I can get!!
Thanks
Erick
--
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
https://www.facebook.com/discussexcel
FORUM RULES
1) Use concise, accurate thread titles. Poor thread titles, like Please Help,
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.
NOTE : Don't ever post confidential data in a workbook. Forum owners and
members are not responsible for any loss.
---
You received this message because you are subscribed to the Google Groups "MS
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.