+ Reply to Thread
Results 1 to 6 of 6

If a value in column h = x then copy multiple rows

  1. #1
    Registered User
    Join Date
    06-13-2013
    Location
    New Mexico
    MS-Off Ver
    2016
    Posts
    16

    If a value in column h = x then copy multiple rows

    I have been trying to do this with simple formulas, but with no luck. I am not very familiar with VBA, but do write reports in other software. Here's what I am trying to do:

    If a cell in column H contains "CALL" I need to copy that row + the following 3 rows to the next worksheet. (Some of the following rows contain merged cells also.)

    IE:
    If
    SHEET1!H30 = "CALL"
    then paste
    SHEET1!40:43

    This seems very simple to me, but I keep running into issues. Please help! I so don't want to be working on this all night. LOL

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If a value in column h = x then copy multiple rows

    Attach a sample workbook. Make sure the data make clear what is needed. Include BEFORE and AFTER sheets in the workbook if needed to show the results you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-13-2013
    Location
    New Mexico
    MS-Off Ver
    2016
    Posts
    16

    Re: If a value in column h = x then copy multiple rows

    Here is my sample. Any time "CALL" appears in Attendance Tracking!H:H I need the row it is in and the next three rows to copy to Sheet2.
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If a value in column h = x then copy multiple rows

    Try this:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-13-2013
    Location
    New Mexico
    MS-Off Ver
    2016
    Posts
    16

    Re: If a value in column h = x then copy multiple rows

    That worked for what I was trying to do, but of course; the data needed changed, slightly. SO - what all do I need to change in order to make it the three rows above/prior and the row which has "CALL"?

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If a value in column h = x then copy multiple rows

    Like so:

    Please Login or Register  to view this content.

+ 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