+ Reply to Thread
Results 1 to 7 of 7

VBA DataVase Info Retrieval Problem

  1. #1
    Registered User
    Join Date
    03-23-2013
    Location
    lincoln england
    MS-Off Ver
    2010
    Posts
    75

    VBA DataVase Info Retrieval Problem

    Hi some very kind user has already been a great help to me and written some code for retrieving data from a database file and copying a sum of values into a specific cell as follows.

    Database contains 24 rows per day and has a columns (column c) which is sales for every hour of that day.

    the code that is already written takes the sum of those 24 hours rows in column c and pasted the answer in the next available cell in a range on another sheet.

    It is easy to see when you look at the attached file.

    However can anyone see why it might not be copying data from the 5th to the 12th specifically, because I am stuck.

    Thanks in advance,
    Dan.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA DataVase Info Retrieval Problem

    Try the attached
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-23-2013
    Location
    lincoln england
    MS-Off Ver
    2010
    Posts
    75

    Re: VBA DataVase Info Retrieval Problem

    Thanks however the database that I pull data in from displays the date in this format yyyymmdd that is why I was having the issues in the first place I believe that attached sheet that I uploaded does it all ok apart from between those dates.

    Dan

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA DataVase Info Retrieval Problem

    Dan,
    The code you have does not pick up the dates because they are not recognised as date by the code, hence I had to change the data in date format. If you look at my code, it starts by converting any data you have in to date format. Since your dates in sales sheet are as formatted as dd/mm/yyyy, I had to convert them in to that format for the dates to match. The code worked on the sample and should work with any data as long as the data in column A are converted in to date format, but if you are happy with the code you have that is fine.

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

    Re: VBA DataVase Info Retrieval Problem

    The sheet you attached has only the 11th and the 25th and the code runs as is????
    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

  6. #6
    Registered User
    Join Date
    03-23-2013
    Location
    lincoln england
    MS-Off Ver
    2010
    Posts
    75

    Re: VBA DataVase Info Retrieval Problem

    AB33 I just tried to runt he SumS() routine, and it came up with an overflow error on this line...
    Please Login or Register  to view this content.

    Dan

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA DataVase Info Retrieval Problem

    Dan,
    I really do not know as you can see from both attached. You might have changed the name of paste. See attached. I did not get any error.
    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)

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