Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    May 2005
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: pull cell data from a import text file (excel)

    is there a different between a microsoft Excel Worksheet and a 002 File?

  2. #2
    2 Star Lounger
    Join Date
    May 2005
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    pull cell data from a import text file (excel)

    Edited by HansV to provide link to post using <!t>[post: 480482]<!/t>.

    I am doing somthing similar but maybe more difficult then this <post#=480482>post 480482</post: >

    I have a macro which imports data from a text file. I used the recorder to see if I could do this macro through it. and have attached code which the recorder made.

    Similar to 480482 I too need to extract data from a row which has a value greater then 0. and pull the cell out from Column "AS" of the row which has the first value greater then 0.

    I might need to describe more, but not sure anyone has done this before, but I thought I try to ask on this Forum.

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: pull cell data from a import text file (excel)

    Could you describe in a little more detail, what the text file looks like (perhaps attach an example) and what you want to do with it and where you want it to go?. It is not clear from your description what exactly you want to do.

    Steve

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: pull cell data from a import text file (excel)

    What is an "002" File?

    A Worksheet is not a file it is part of a workbook file.

    Steve

  5. #5
    2 Star Lounger
    Join Date
    May 2005
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: pull cell data from a import text file (excel)

    Ok, I need to import a text file from a folder, there are many folders with one folder. The problem is I need to import the data find a cell. I have attached 1 of the text files I am workin on. Right now I have to do it manually and there is like 1500 of them. So I though about making a Macro. In the text file I have imported I need to go through the G column until I find the first value greater then 0. row 44 in this case. then I need to move to column AS at row 44 and copy the value there, and paste it in a column in a workbook which will hold my pasted data. It be helpful to copy cell B4 which is location and paste it beside the value pasted from AS for each text file.

    Thanks for taking a Look

  6. #6
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: pull cell data from a import text file (excel)

    You have not attached a text file you have attached a workbook.

    Will you be working with a workbook like this for the macro?
    Let me make sure I understand what you want.

    You want a macro to go thru the values in Col G to find the first cell containing a number that is >0.
    Once it finds that row (in example row 44) copy the value of of col AS from the row and paste it somewhere
    [Where to you want it paste to?]
    Also copy the value for B4 of the sheet and paste it "beside" the AS value (Where should it be pasted, to the right, left, above, below the other value]

    Since you have 1500 text files to import, how are you going to import them?

    You could use GetOpenFilename to select them, then read thru each selected, import it (you might need code to parse it if it does not parse directly in excel), then read the info, save it wherever, then close the imported text and open the next one, etc...

    If you need with the actual code, you will have to provide more details...
    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •