+ Reply to Thread
Results 1 to 4 of 4

how to loop until last column and copy header base on row not empty.

  1. #1
    Registered User
    Join Date
    05-21-2018
    Location
    Malaysia
    MS-Off Ver
    2016
    Posts
    94

    how to loop until last column and copy header base on row not empty.

    i want to loop every column to check the row(row is base on "Match",so it got 3 row then will check 3 row cells) is empty or not ,if yes will copy header and paste to another sheet.

    attached is Excel example

    the output will have A003 because it is not empty(filled with "X").
    Attached Files Attached Files
    Last edited by Step01; 07-24-2018 at 02:34 AM. Reason: added Excel file example

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: how to loop until last column and copy header base on row not empty.

    Attach a workbook showing data before and after.

  3. #3
    Registered User
    Join Date
    05-21-2018
    Location
    Malaysia
    MS-Off Ver
    2016
    Posts
    94

    Re: how to loop until last column and copy header base on row not empty.

    okay, i am preparing a workbook,thanks.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,565

    Re: how to loop until last column and copy header base on row not empty.

    It appears that the output should include only the header ID's that have X's for all ID numbers.
    That being the case try (on the data sheet):
    1) In B1048576 and across: =COUNTA(B1:B20)
    2) In XFD2 and down: =IF(ROW()=2,B2,IF(B2<>"",XFD1&", "&B2,XFD1))
    On the output sheet:
    1) In B2 and down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    2) In C2 and down: =IF(B2="","",INDEX(Data!XFD$2:XFD$20,COUNTA(Data!XFD$2:XFD$20)))
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. [SOLVED] To Loop and Subtotal by column header
    By caooi23 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-29-2015, 06:14 AM
  2. Replies: 1
    Last Post: 10-05-2013, 03:35 PM
  3. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  4. Macro to add column header text in the first empty column
    By pjkitty in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2012, 07:53 AM
  5. How to hide all empty columns without including the column header
    By mkingsberry in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-09-2010, 12:27 PM
  6. Colour empty cells if under Column Header x
    By Jessica.Bush in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-12-2010, 08:36 AM
  7. Automatically copy row header to column header...
    By Soons in forum Excel General
    Replies: 4
    Last Post: 10-16-2008, 11:38 AM

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