+ Reply to Thread
Results 1 to 4 of 4

Macro for compare and copying using loop function

  1. #1
    Registered User
    Join Date
    11-22-2014
    Location
    US
    MS-Off Ver
    Office 365
    Posts
    83

    Macro for compare and copying using loop function

    There are 2 sheets - sheet 1 and sheet 2

    sheet 1 has data in the group name as headers. I want the macro to compare each header in sheet 1 with the column D of sheet 2. if the column heading matches the data with that of column D then its corresponding data in the column B of sheet 2 should be copied to column A of sheet 1.

    That is if A present in column D of sheet 2 then all the data that has the group name as A should be copied to column A of sheet 1. The macro has to loop in till it finds the group name A and copy them to column A.
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro for compare and copying using loop function

    try it
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-22-2014
    Location
    US
    MS-Off Ver
    Office 365
    Posts
    83

    Re: Macro for compare and copying using loop function

    Thank you Nilem!! it works. But is it possible to pull the data as per the column headings in the sheet 1 from sheet 2 and paste them on sheet 1 below the respective headings?

    i feel that will make my work more easy.

    your macro works very well its just i want a little modification to make my job easier.

    Thanks a lot

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro for compare and copying using loop function

    Hi sarajun_88,
    perhaps you mean about it
    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)

Similar Threads

  1. Need help to loop function for working macro
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2014, 05:53 AM
  2. Macro Loop with What If function
    By Phil.Good in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2013, 08:05 AM
  3. Macro to Loop Function throughout selected cells
    By Alvinz in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-20-2012, 08:57 AM
  4. copying cells when column A equals certain text, loop function?
    By djl304 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-17-2009, 09:13 PM
  5. Macro Loop with Match Function
    By bigbavarian in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-01-2009, 03:39 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