Extract Dynamic Data From Closed Workbook

  • Hi there, i have this code that could extract out Data from many closed workbook. I am extracting data from 2-3 thousand files and the Data in those files are rather dynamically positioned.


    For e.g. My vba codings will extract data from cell B256 of the closed workbook. Sometimes, the data might not start from that cell which my vba would still extract that non-relevant data.


    Is there anyway i can modify the codings to search for the required data and extract instead of extracting it dumbly?


  • Re: Extracting Dynamic Data From Closed Workbook


    is/can the starting cell be identified with a particular sign ( header, etc. ) ?


    could you post a couple of examples ( in the same workbook, different worksheets ) to see how this appears?


    filippo

  • Re: Extracting Dynamic Data From Closed Workbook


    So you are opening each of the 2 - 3 thousand xl files just to extract anywhere from 1 to 5 pieces of information???



    Sounds like a lot of work to have to do. In the workbooks are the sheet names identical???



    I would instead of opening each workbook. Create a worksheet in which you create the 5 links and then modify the linked formula to identify the particular workbook.


    As far a picking the right cell to extract. You need to test each cell and see if it contains the value that you are looking for. You don't specify how to identify the cell that has the value the you want to extract. I'm going to assume that only 1 of the identified cells will contain data and the others would be blank. IN that case you would just look for the non blank cell....



    More information is needed to give you further help.. Maybe a posting of a target workbook.

  • Re: Extracting Dynamic Data From Closed Workbook


    This is one of the example files that i will be extracting data from. This file is actually in slk format.


    There is a unique header for the particular data that i am suppose to extract. However, it is often not in the right cell as in the Data might be located at cell B250 in one file and the next file it would be in B255 and B350. They will always be in the same column but different row. The headers are unique.


    this is because this file is consolidated from someone else over don't know how many god donkey years and its inconsistent in row but not for column.

  • Re: Extracting Dynamic Data From Closed Workbook


    iwrk4dedpr:


    The file contains many other unwanted information and i just want to filter out those information that i want and put it in an excel sheet so that i can sort it out to do some statistic for it. Actually i need to extract out at least 40 information that is in order of a list.


    Thank you filo65 and iwrk4dedpr for the help.

  • Re: Extracting Dynamic Data From Closed Workbook


    Quote from Dave Hawley


    Hi Dave, Thanks for the site but its not helping as
    1) The data is generated by server
    2) every data generated is hell lot of info
    3) i can't extract all the info because all that will cause me to not have enough rows for the data
    4) i need specific data and not all the data so that i can compile a statistic from the specific data collected and not redundant data.


    Thanks & Rgds,
    thunder

  • Re: Extract Dynamic Data From Closed Workbook


    try


    Code
    Sub look_for_range()
      Dim begArea As Range, endArea As Range
      Range("A1").Select
      Set begArea = Columns(1).Find(What:="URLs", After:=ActiveCell, LookIn:=xlFormulas, _
            LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
            MatchCase:=False, SearchFormat:=False).Offset(3, 1)
      Set endArea = begArea.End(xlDown).Offset(0, 1)
      
      Range(begArea.Address & ":" & endArea.Address).Select
    End Sub


    filippo

  • Re: Extract Dynamic Data From Closed Workbook



    hmmm... this also doesn't seem to work ... filo thanks for the coding...

  • Re: Extract Dynamic Data From Closed Workbook


    thunder,


    instead of

    Quote

    selectedcells = Range(begArea.Address & ":" & endArea.Address).Select.Copy


    try

    Code
    selectedcells = Range(begArea.Address & ":" & endArea.Address).Copy


    where it doesn't work?, do you get an error message? which one?


    filippo

  • Re: Extract Dynamic Data From Closed Workbook


    Hmm... i do not get any error.. neither do i get any results...


    i went to do a breakpoint and i find that it does open the closed workbook but it just doesn't select the selected info that i want and copy into the workbook that is suppose to consolidate all the info

  • Re: Extract Dynamic Data From Closed Workbook


    In this line, rCell is declared (implicitly) as a variant:

    Code
    Dim rCell, selectedcells As Range


    What is this line of code trying to do?

    Code
    selectedcells = Range(begArea.Address & ":" & endArea.Address).Select.Copy


    And this one?

    Code
    rCell.FormulaR1C1 = selectedcells

    [SIZE=1]Entia non sunt multiplicanda sine necessitate.[/SIZE]

  • Re: Extract Dynamic Data From Closed Workbook


    This line is trying to copy those cells from closed workbook

    Code
    selectedcells = Range(begArea.Address & ":" & endArea.Address).Select.Copy


    and paste it in the open workbook

    Code
    rCell.FormulaR1C1 = selectedcells
  • Re: Extract Dynamic Data From Closed Workbook




    I've changed the codings and now after the pastespecial the only thing that appear on my excel file is TRUE. Don't know what is happening

  • Re: Extract Dynamic Data From Closed Workbook


    I suggest you post two workbooks, the target and the source one with some consistent data. In the previous attachment it was not included what your were looking after


    filippo

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!