Consulting

Results 1 to 3 of 3

Thread: Copying Characters to the Right of a Selected String in a .txt file

  1. #1
    VBAX Newbie
    Joined
    Jul 2011
    Posts
    2
    Location

    Copying Characters to the Right of a Selected String in a .txt file

    I am trying to make a VBA macro in Excel that searches for 5 characters to the right of a selected string in a .txt file and pastes it in the selected cell of choice. Can anyone help?

    thanks

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Welcome to the forum!

    I have looked at this but can not understand what need exactly. What application is your cursor in when you want to play this macro? Is the selected string in Excel or in the text file? Try posting an example text file with example data.

  3. #3
    VBAX Newbie
    Joined
    Jul 2011
    Posts
    2
    Location
    I have several text file that have about a page of geographical text and i want to only extract the latitude, longitude, and elevations data from each of them. The format is the same but the data that i want to extract is different every time. So i was thinking that if i looked for a selected string that is consistant within each file i could export only the character to the right of the string.

    e.g. within file#1 "latitude 123 23 12" -> String = "latitude "
    within file#2 "latitude 123 22 30"

    (In Excel) Furthermore, i would like to placed the files latitude, longitude and elevation along a row and the different files to be placed along a column.

    I hope this makes sense,
    thanks

Posting Permissions

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