+ Reply to Thread
Results 1 to 3 of 3

Macro to copy data from previous column according to criteria.

  1. #1
    Registered User
    Join Date
    09-16-2010
    Location
    Glasgow
    MS-Off Ver
    2010
    Posts
    68

    Macro to copy data from previous column according to criteria.

    Hi everyone,

    I have a worksheet which contains 4 columns:

    - Column 1 is the hostname
    - Column 2 defines if the hostname is a chassis or a module number (if known)
    - Column 3 is the product ID (if known)
    - Column 4 is the chassis product ID (column currently empty)

    See screenshot Row Data.jpg

    For all hostname instances, I would like the 4th column to contain the product ID from column 3 when the value from column 2 = Chassis. See screenshot Row Data - Outcome.jpg

    For instance for hostname 36sas-tr-r2 (located in cell R2C1), I would like cell R2C4 to contain the value "CISCO3640,CISCO3640A" (taken from cell R2C3) since cell R2C2 = Chassis. Then for the remaining rows which refer to hostname 36sas-tr-r2 (i.e. rows 3 and 4), I would like the same value "CISCO3640,CISCO3640A" to be copied into cells R3C4 and R4C4 (as column 2 at rows 3 and 4 is not equal to Chassis).

    Any help creating such a micro would be appreciated.

    Row Data.xlsx

    Thanks a lot,
    Ant
    Last edited by Folshot; 04-18-2011 at 08:21 PM. Reason: Added [SOLVED] to title.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: Macro to copy data from previous column according to criteria.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-16-2010
    Location
    Glasgow
    MS-Off Ver
    2010
    Posts
    68

    Re: Macro to copy data from previous column according to criteria.

    Thanks again nimrod, second time you help me and again it perfect! Thanks a lot.

+ 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