+ Reply to Thread
Results 1 to 2 of 2

copying cells by checking color of the cells

  1. #1
    Registered User
    Join Date
    01-24-2006
    Posts
    1

    copying cells by checking color of the cells

    hi, sorry that I need help in creating the following:

    column B of Ws2 contains the IDs(may have repetition).

    When it runs, it will go to Ws1:column A to look for the same ID.

    Search for the cells with color 'blue' on the whole row below the ID in Ws1.

    If there are 2 same ID(e.g. two of ID001) on Ws1:Column A, and 2 blue colored cells that have fields "1" and "2" respectively under same ID001. It will end up like this:

    ID001: 1
    ID001: 2

    Then, copy those cells over to Ws2:column E on the same ID row.

    Next, in Ws1, from the copied cell, go to row 121 of that column, copy the fields in the (row 121:column with the blue copied cell), and paste it over to Ws2:column D on the same ID row.

    This is real hard for me as I tried it out alot of times, but failed.. I know its rather troublesome but really hope someone out there will help me.. please..

  2. #2
    Forum Contributor
    Join Date
    01-10-2006
    Location
    Ahmedabad, India
    MS-Off Ver
    Office 2000
    Posts
    346
    Quote Originally Posted by JJJ010101
    hi, sorry that I need help in creating the following:

    column B of Ws2 contains the IDs(may have repetition).

    When it runs, it will go to Ws1:column A to look for the same ID.

    Search for the cells with color 'blue' on the whole row below the ID in Ws1.

    If there are 2 same ID(e.g. two of ID001) on Ws1:Column A, and 2 blue colored cells that have fields "1" and "2" respectively under same ID001. It will end up like this:

    ID001: 1
    ID001: 2

    Then, copy those cells over to Ws2:column E on the same ID row.

    Next, in Ws1, from the copied cell, go to row 121 of that column, copy the fields in the (row 121:column with the blue copied cell), and paste it over to Ws2:column D on the same ID row.

    This is real hard for me as I tried it out alot of times, but failed.. I know its rather troublesome but really hope someone out there will help me.. please..
    Your problem is not very clear. Col B of WS2 has IDs and there can be duplicates. That means more than one row, say two rows, under col B of Ws2 have same ID- say ID001. Now you want to go to WS1 scan Col A and look for same ID ID001. If it finds any row in this col A with ID001 then you want to scan that row for blue cells. Can it encounter more than on blue cell? upto how many cols you want to scan? ( Does WS2 table has fixed number of cols?). If there are say two blue cells in row with values "1" and "2". Should it go for further scanning of col A for more occurences of ID001? If it finds more such occurences and more corresponding blue cells, what do you want to do? e.g for ID001 you may get data from WS2 like
    ID001 1 2
    ID001 3 4

    You said you want to copy this data to Col E of WS1 in the row where colA has ID001. But data obtained from WS2 will require two rows and two cols ( total number of values obtained are 4 - "1","2","3" and "4" ). Should this data be pasted in col E and ColF and two adjacent rows? Since colB of WS2 may have multiple occurence of ID001 should this be repeated every time ID001 is encountered in ColB? Similarly not clear what you want to copy to WS2. Please define your problem clearly. Especially with the assumption that there can be multiple instancess of same ID in ColB of WS2 and ColA of WS1 and again multiple instances of blue cells across an ID in WS1, it is not clear what you want to do. We will try out something once problem is clear.

    A V Veerkar

+ 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