+ Reply to Thread
Results 1 to 6 of 6

Macro to loop through a column

  1. #1
    Registered User
    Join Date
    11-06-2008
    Location
    nigeria
    Posts
    25

    Macro to loop through a column

    Please everyone,

    I seriously need help on this!!!

    I need a macro to loop through a column 'A' in the 'raw' worksheet and pick out each tag and paste it in the tag column 'A' of the 'done' worksheet.

    For each tag, there are certain attributes such as BAO, SAO, HHALIM, HAL, in adjacent columns. Their values are in the cell next to them. In the 'done' worksheet they are all arranged out .

    As the macro loops through the column A, for each tag pasted, it should pick out these attributes and pastes their values in under these attributes in the 'done' worksheet.

    the workbook is attached.

    Thank you very much for your help.

    Excel
    Attached Files Attached Files

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Macro to loop through a column

    I have looked at your sample workbook and I cannot see what you are trying to do.

    Could you add a little more to the "done" sheet to help me understand your problem?

    eg I cannot find DALOPT in "tags" sheet

  3. #3
    Registered User
    Join Date
    11-06-2008
    Location
    nigeria
    Posts
    25

    Re: Macro to loop through a column

    Thanks,

    I have transffered some data to the 'done' worksheet, and this is what the outcome of the final macro execution should be.

    the 'tags' worksheet is not exhuastive for now, the data are more, thats why DALOPT is not there for now.

    attached is the updated workbook
    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: Macro to loop through a column

    This should get you started, you can expand the search sections to include the sections which weren't represented in your data. I marked the columns already included in the code somewhere in dark green.
    Please Login or Register  to view this content.

    Just click the button on the "done" sheet.
    Attached Files Attached Files
    _________________
    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!)

  5. #5
    Registered User
    Join Date
    11-06-2008
    Location
    nigeria
    Posts
    25

    Re: Macro to loop through a column

    Thanks, that really works.

    Thanks very much.

  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: Macro to loop through a column

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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