+ Reply to Thread
Results 1 to 5 of 5

Extracting Data from Excel to copy and Paste

  1. #1
    Registered User
    Join Date
    12-13-2009
    Location
    new york, usa
    MS-Off Ver
    Excel 2003
    Posts
    17

    Question Extracting Data from Excel to copy and Paste

    I have data in Excel in 3 columns.

    Column A has Date
    Column B has Time
    Column C has Stock Price

    I am trying to copy the stock price for a certain time interval each day for different dates and paste them to column F.

    eg. I would like to copy stock prices between 10:30 am to 11:00 am for the dates 8/10/09 to 8/15/09 and paste the data to column F.

    How can I create a macro to do this?

    I have attached a sample data sheet herewith.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Extracting Data from Excel to copy and Paste

    Hi,

    See attached

    Put your required times in L1 & L2 in the format 12:40:10

    Please note that your times in column B are not time numbers, hence it's necessary to add the helper column D which converts column B to time numbers that Excel can use.

    Please also note that the Dates are not proper date numbers either - they have a leading space. I know you don't need to use these dates for any analysis in this example but for future reference you should always try to get dates and times into a proper Excel number format so that Excel has something to work with.

    Note: the forum seems to have a problem uploading files at the moment. I'll attach as soon as it's available.

    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    12-13-2009
    Location
    new york, usa
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Extracting Data from Excel to copy and Paste

    Thank you Richard.

    I will wait to see your attachment. I was able to upload mine, a few minutes before your reply.

  4. #4
    Registered User
    Join Date
    12-13-2009
    Location
    new york, usa
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Extracting Data from Excel to copy and Paste

    Richard, perhaps this is what you may have been referring to, I just realized the data in the worksheet has been saved in text format. Sorry did not realize/mention that earlier.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Extracting Data from Excel to copy and Paste

    Hi,

    See attached

    It seems the size of the file was too large although why you're original uploaded and this one didn't I can't fathom. I've had to remove rows below 2500 but no doubt you can copy them back in/

    Regards
    Last edited by Richard Buttrey; 01-31-2010 at 11:50 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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