+ Reply to Thread
Results 1 to 4 of 4

Re-useability:Search a keyword and copy adjacent cell to in another sheet

  1. #1
    Registered User
    Join Date
    05-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Re-useability:Search a keyword and copy adjacent cell to in another sheet

    Hello,

    I have imported an XML document (Sheet1) and want to search the text "Sql Query" (say column CW, row 300), and paste the adjacent cell (CX300) in Sheet2. I have tried to do so in two ways, using vlookup and recording a macro. In both of them, the column with contains the keyword "Sql Query" freezes and it makes it impossible to reuse the same for the next imported XML document as the XMLs do not have same structure, their grain differs but they do have "Sql Query". The second XML had "Sql Query" in CZ 340 and CZ 408. Could any one help me out with the same? The column with has "Sql Query" might move and if there are multiple instances of "Sql Query", they will fall under the same column and I need to copy the adjacent cells in another sheet, say column A.

    Regards.

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Re-useability:Search a keyword and copy adjacent cell to in another sheet

    Hello and welcome to the Forum.....hey, would it be possible to attach a file with all the company confidential stuff removed....it is so much easier to help when we don't have to make up the data to test stuff....
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Re-useability:Search a keyword and copy adjacent cell to in another sheet

    a macro could be written for that, however, why can't you use find and search for Sql Query, then filter that column and select the column that you need, hit F5, special..., select visible cells, then paste all of them at the same time?

  4. #4
    Registered User
    Join Date
    05-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Re-useability:Search a keyword and copy adjacent cell to in another sheet

    Quote Originally Posted by scott.s.fower View Post
    a macro could be written for that, however, why can't you use find and search for Sql Query, then filter that column and select the column that you need, hit F5, special..., select visible cells, then paste all of them at the same time?
    I would, if either I were to stop after the copy or the process wasn't recursive, however, I have some more functionality to go forward with after I copy them in another sheet. If I could make use of a macro to search and copy, and then the other macros I need.. it'd same a lot of time. I have around 50 XMLs. I was thinking it'd be better if I export the XML, hit a button and have the results.
    Is there any better way? I'm quite new to all this and might be thinking in a wrong direction.

    Quote Originally Posted by judgeh59 View Post
    Hello and welcome to the Forum.....hey, would it be possible to attach a file with all the company confidential stuff removed....it is so much easier to help when we don't have to make up the data to test stuff....
    thank you so much
    Of course. I should have attached the file in the OP itself..
    Sheet1 has the imported XML which I had to clean up. I have highlighted the required columns CW and CX (test1). If I import another XML(test 2), the position of these two column changes.
    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