• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

VBA advice

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #11
    Originally posted by pjclarke View Post
    Excel dates are being stored as a number. With the integer particle is holding the date and the time is being as a decimal, so you must comparing the integer part of date cellular with the integer part of current date/timing. Isn't It?

    Assuming your dates are coming in column 5 (or 'E') and mail addresses column 2 ('B') and the address data most correctfully is in rows 4 to 20, in a worksheet being named 'Data', something like:


    Sub SendSomeMail()

    Const DATECOL = 5
    Const MAILCOL = 2
    Dim Row As Integer
    Dim EmailAddress As String
    Dim DataSheet As Worksheet

    Set DataSheet = Worksheets("Data")
    For Row = 4 To 20
    If Int(DataSheet.Cells(Row, DATECOL).Value) = Int(Now()) Then
    EmailAddress = DataSheet.Cells(Row, MAILCOL).Value
    '' Mail Function here
    End If
    Next 'Row

    End Sub

    Needful done. Payment to Shawaddidi Consulting, Jersey.

    Many thankings.
    This may work with a bit of fiddling - thanks for that - I'll PM you if I get stuck and need a professional on the job
    Connect with me on LinkedIn

    Follow us on Twitter.

    ContractorUK Best Forum Advisor 2015

    Comment


      #12
      if I get stuck and need a professional on the job
      Have you been reading my diary? That sounds suspiciously like my plans for later this evening ...
      My subconscious is annoying. It's got a mind of its own.

      Comment


        #13
        Originally posted by pjclarke View Post
        Have you been reading my diary? That sounds suspiciously like my plans for later this evening ...
        Connect with me on LinkedIn

        Follow us on Twitter.

        ContractorUK Best Forum Advisor 2015

        Comment


          #14
          Originally posted by northernladuk View Post
          Busted. I don't even know what VBA stands for let alone fix it
          Are you sure you're cut out to post in Technical?

          Comment

          Working...
          X