Consulting

Results 1 to 2 of 2

Thread: Looping through a range and assigning the row # to a variable when found

  1. #1
    VBAX Regular
    Joined
    Nov 2012
    Posts
    57
    Location

    Looping through a range and assigning the row # to a variable when found

    Hey guys,

    Don't have any code written yet, since I'm not sure where to begin. What I need is code that will loop through a range which contains a date as MMM-YY. Right now, I have Cells A4:A15 which contain Jan-15 through Dec-15. When the macro runs, I would like for it to look at the sysdate and assign the row # that contains the sysdate MMM-YY to a variable for me to use.

    For example, since I am running this now in Jul-15, it would look through A4:A15 and assign the number 10 to a variable, since that's the row in which Jul-15 is contained.

    Please let me know if this needs more clarification and thanks in advance.
    JS

  2. #2
    VBAX Regular
    Joined
    Nov 2012
    Posts
    57
    Location
    Sample Book.xlsx

    Sample workbook attached. I have left the data out, but it should still be clear what i want to do I think. The range of dates is in A4:A15.

Posting Permissions

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