+ Reply to Thread
Results 1 to 3 of 3

Looping Until Matches Date

  1. #1
    Registered User
    Join Date
    03-28-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    8

    Looping Until Matches Date

    Hi,

    I am new to VBA programming and have tried to create a loop that copy and pastes values from right to left. The StartDate is in the copy and paste section I am copying and pastesing repeatedly. The CurrentDate is at the top of my spreadsheet. There are different dates that are at the top of the sheet every 10 or 11 columns on the top row

    So what I am having a problem with is I want the Activecell.offset to work on what the loop pastes to then check the CurrentDate on the top row above. What it is currently doing is just referring to the CurrentDate at the top at the start of the loop but not moving along with the pasting of the data and then lookup up to top row above where it is when it pastes the lasted loop.

    So lets say the "StartDate" is 10/10/2012 at the top "CurrentDate" it has the dates from around 07/07/2018 and is at the top row all the way back to 02/02/2002 so along the way the "StartDate" will match the "CurrentDate" and it should stop looping.

    Hope I am making sense. Below is my attempt which is not working.

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 09-18-2018 at 11:49 AM. Reason: Please use code tags!

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Looping Until Matches Date

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    03-28-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Looping Until Matches Date

    Hi xladept,

    Thanks for your guidance. I have uploaded what I am looking to do, before and after.

    Thanks
    rutrading
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] If date matches and room matches, return room info in to cell
    By HonorBray in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-12-2018, 12:09 PM
  2. Help with looping through index function to get all matches in vba
    By kpaull in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2016, 12:49 PM
  3. [SOLVED] find date that matches date on my sheet and copy from table below.
    By k1989l in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-07-2016, 08:02 AM
  4. Replies: 9
    Last Post: 10-08-2015, 01:50 PM
  5. Replies: 8
    Last Post: 03-07-2014, 03:12 PM
  6. [SOLVED] Codes for looping thru all file when matches found
    By cokillerliu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2013, 11:29 PM
  7. Mark cell if location matches and date falls between date range
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-24-2012, 07:54 PM

Tags for this Thread

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