+ Reply to Thread
Results 1 to 4 of 4

Formula to export two rows above and two rows below of a "word" to another sheet.

Hybrid View

  1. #1
    Registered User
    Join Date
    03-07-2020
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    2

    Formula to export two rows above and two rows below of a "word" to another sheet.

    Hi all and thank you in advance to anyone whom is able to help me.

    This might be very simple however I have a long bank statement and wish to search for the word lotto, once found I wish for two rows either side to be exported to another sheet.

    I would paste an example however I have converted a pdf to an xls and it is very messy..meaning that all of the rows are weird and instead of all of the info being in 4-6 columns it is probably taking up about 200 yet is automatically condensed so I can some what understand what is happening.

    Basically this is a formula for a search query and upon receiving the word " lotto" two rows above and two rows below will be automatically exported to another sheet, thus saving me having to got through many lines manually.

    Thanks again to anyone whom can help.

  2. #2
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: Formula to export two rows above and two rows below of a "word" to another sheet.

    Maybe you can make two helping columns
    and place in the first column:
    =FIND("lotto",A3)
    and in the second column:
    =IF(B3<>0,1,IF(B4<>0,1,IF(B5<>0,1,IF(B2<>0,1,IF(B1<>0,1,0)))))
    and thenyou can do the coloring with conditional formatting
    B/R
    Erwin
    I started learning VBA because I was lazy ...
    Still developing.... being more lazy...

  3. #3
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: Formula to export two rows above and two rows below of a "word" to another sheet.

    Screenpost
    B/R
    Erwin
    Attached Images Attached Images

  4. #4
    Registered User
    Join Date
    03-07-2020
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    2

    Re: Formula to export two rows above and two rows below of a "word" to another sheet.

    EastW00d,

    Thank you VERY much for your response.

    I will try this method and let you know how I go.

    Stoked !

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 35
    Last Post: 01-13-2016, 02:16 AM
  2. Looping thru rows and copy cell values from "Inputs" sheet to "Output" sheet
    By hariexcel1987 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2015, 11:32 PM
  3. Export the sheets to PDF Format which has the word "Summary" in Sheet Names
    By Kandavalli.Kiran in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2015, 09:14 AM
  4. Replies: 1
    Last Post: 02-04-2014, 08:43 PM
  5. Replies: 1
    Last Post: 09-21-2013, 03:18 AM
  6. [SOLVED] I hope to display only rows containing the word "Total" in the attached sheet.
    By mstone2112 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-21-2013, 06:40 PM
  7. Replies: 1
    Last Post: 03-08-2011, 03:32 PM

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