+ Reply to Thread
Results 1 to 3 of 3

Copy whole row if cell X contains a number

  1. #1
    Registered User
    Join Date
    03-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    Excel 2007
    Posts
    18

    Copy whole row if cell X contains a number

    Hi,

    I got a (for me) quite challenging problem.

    I have two sheets. One sheet called 'Input' and one sheet called 'Accrual'. Please see attached workbook (only a section of the workbook to show how the sheets related to my problem looks).

    The 'Input' sheet is quite big (about 6500 rows), so I think I need a macro.

    What I want the macro to do:

    I want all the rows which contain a number in the column "Accrual" (column U) to be copied into the 'Accrual' sheet. I also want the Employee No., Full Name & Position (only shown in the first row column A, B & C in 'Input' sheet for each empoyee to show on every row copied to the 'Accrual' sheet.

    Each "Employee box" is the exactly same size/setup/layout/number of rows etc.

    Maybe not the best explanation, but if you look into the attached workbook, I have marked what I want copied in the 'Input' sheet yellow, and similar how/what I want (it) to show up in the 'Accrual' sheet.

    The macro need to run from row 2 until row 6500 in the 'Input' sheet.

    I don't expect any to touch this problem, but if you have time and interest to help it would be highly appreciated! :-)
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Copy whole row if cell X contains a number

    the file "siglen book1.xlsm" is returned with a macro in the mdoule ( which is also repeated below)
    your Actual sheet is named "actual original" and new sheet "actual" is inserted

    see sheet "actual" which is AFTER running the mcro .
    to retest run the macro again
    NOTE: VALUES IN U ARE POSITIVE (NOT NEGATIVE)

    Please Login or Register  to view this content.
    Attached Files Attached Files
    I am not an expert. better solutions may be available
    [email protected]

  3. #3
    Registered User
    Join Date
    03-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Copy whole row if cell X contains a number

    Thanks venkat1926! It works perfect :-)

    Only one question: if I hide some columns in the "Input" sheet, the macro doesn't copy these columns to the "Actual" sheet. Do you know how I possible may adjust it to do so?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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