Results 1 to 5 of 5

Lots of IFs based on User-inputted date

Threaded View

lieb39 Lots of IFs based on... 11-29-2010, 04:12 PM
watersev Re: Lots of IFs based on... 11-29-2010, 05:01 PM
mikerickson Re: Lots of IFs based on... 11-29-2010, 05:01 PM
lieb39 Re: Lots of IFs based on... 11-30-2010, 10:33 AM
lieb39 Re: Lots of IFs based on... 11-30-2010, 12:08 PM
  1. #1
    Registered User
    Join Date
    11-29-2010
    Location
    NYC
    MS-Off Ver
    Excel 2003
    Posts
    11

    Lots of IFs based on User-inputted date

    Hello everyone,

    This is a tricky one, any advice is appreciated here.

    I need the user to input a date into my Excel Macro through a popup (InputBox)

    Using that input (We'll call it MailerDate) we need to:

    For each row...

    Compare the input (MailerDate) to the date in column T ('Contract End') [Format: DD/MM/YY)]


    If the date is anything up to 1 Month minus 1 day *after* MailerDate, the V column (of that row) needs to be changed to 0.

    If the date in column T is 1 month after MailerDate TO 2 months minus 1 day after MailerDate, value of the V needs to be changed to 1.

    If the date in column T is 2 months after MailerDate TO 3 months minus 1 day after MailerDate, value of the V needs to be changed to 2.

    and so on until..

    If the date in column T is 18 months after the MailerDate to 19 months minus 1 day after the MailerDate, value of the V needs to be changed to 18.


    It's a complicated one - but it's basically a IF statement (or CASE? Not that familiar with the VBScripting) and a InputBox used to input a date.. With a loop to run this to the last row of the excel file.

    Suggestions?

    So far all I have is..

    MailerDate = InputBox("Enter the mailing date - Format MM/DD", "Enter Mailing Date", "MM/DD")

    Dim r As Range, i As Long

    For Each r In Range("V2", Range("V2").End(xlDown))
    If
    {still researching how to do this exactly..}
    End If
    Next r
    Thanks so much!

    Daniel
    Last edited by lieb39; 11-29-2010 at 04:15 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1