+ Reply to Thread
Results 1 to 2 of 2

Problem with midnight date change using VBA macro for adding missing dates

  1. #1
    Registered User
    Join Date
    10-09-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    4

    Problem with midnight date change using VBA macro for adding missing dates

    Hello,

    I have been using the code from this thread:

    http://www.excelforum.com/excel-prog...and-times.html

    It works very well, except that it does not change the date when crossing midnight. i.e. It will go 30/10/12 23:00 then 30/10/12 00:00 then 31/10/12 01:00. Of course, this means that the matching formula does not place the data in the correct place. When I type the formula directly into cells, it works perfectly and changes the date in the expected place. So it is something that the procedure is doing in VBA that stops this from working correctly and I can't for the life of me figure out what, which implies it is something very simple (usually the case!)

    I think it is something to do with formatting, as I have added in some formatting otherwise it always returns no data. The code is below.

    Please Login or Register  to view this content.
    Thankyou in advance for any help.

  2. #2
    Registered User
    Join Date
    10-09-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Problem with midnight date change using VBA macro for adding missing dates

    After further investigation the problem appears to be with the .Value = .Value. For some unknown reason....

+ Reply to Thread

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