+ Reply to Thread
Results 1 to 12 of 12

fill data under headers based on another range in the same sheet

  1. #1
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    fill data under headers based on another range in the same sheet

    hi
    I want filling data under range A:F based on matching headers with K:P . I put resut in second sheet how should be in first sheet
    thanks
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: fill data under headers based on another range in the same sheet

    Please Login or Register  to view this content.

  3. #3
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: fill data under headers based on another range in the same sheet

    Or with a formula: Please try in B2 and copy to right
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-02-2020
    Location
    Indonesia
    MS-Off Ver
    2016 windows
    Posts
    79

    Re: fill data under headers based on another range in the same sheet

    is this what you need?
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: fill data under headers based on another range in the same sheet

    Hi jindon
    thanks for your code.
    I have question I don't see any topic of header in your code . when you have filter based on column 2 , does it mean column ITEM ?
    if it's so I have to explain more . I'm fraid face problem with this solution .

  6. #6
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: fill data under headers based on another range in the same sheet

    @HansDouwe & superjoejoe2000 thanks for fromuals , but I want vba , sorry!

  7. #7
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: fill data under headers based on another range in the same sheet

    Hello. Basically you need to reorder the columns so that the Index function can help you:

    PHP Code: 
    Sub Macro2()
    Columns(5).NumberFormat Range("L2").NumberFormat
    With Range
    ("K1").CurrentRegion
      Range
    ("A1").Resize(.Rows.Count, .Columns.Count) = _
        Application
    .Index(.CellsEvaluate("Row(a1:a" & .Rows.Count ")"), _
        
    Array(316524))
    End With
    End Sub 

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: fill data under headers based on another range in the same sheet

    You have before and after sheet, so you must have prepared header for result.

    Otherwise, simply
    Please Login or Register  to view this content.
    Last edited by jindon; 11-16-2022 at 04:31 PM.

  9. #9
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: fill data under headers based on another range in the same sheet

    @beyond Excel excellent !
    great idea to arranging columns again

  10. #10
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: fill data under headers based on another range in the same sheet

    You have before and after sheet, so you must have prepared header for result.
    yes I don't expect from you use specific column to filter data . I thought you will create code search for headers and brings data .sorry about this confusion ! after tested both codes I will take the first becuase is really fast more than looping .
    thanks very much for two codes .

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: fill data under headers based on another range in the same sheet

    If you use my first code, headers MUST be identical, no miss spelled.

    AdvancedFilter should be the fastest and no need to adjust the formattings.

  12. #12
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: fill data under headers based on another range in the same sheet

    If you use my first code, headers MUST be identical, no miss spelled.

    AdvancedFilter should be the fastest and no need to adjust the formattings.
    thanks for this clarification .

+ 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] auto fill separated range for each sheet based on match sheet name
    By Maklil in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-29-2022, 09:26 AM
  2. [SOLVED] bring data from sheet to another based on topics headers and specific column
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-29-2021, 05:38 PM
  3. Replies: 6
    Last Post: 12-13-2016, 03:06 PM
  4. [SOLVED] Macro to copy paste the data in one sheet to another based on the headers
    By sarajun_88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2016, 10:28 AM
  5. Macro to copy paste the data in one sheet to another based on the headers
    By sarajun_88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2016, 05:32 AM
  6. Replies: 4
    Last Post: 02-08-2014, 02:31 PM
  7. As user fills out data sheet, then fill out a results sheet based on data sheet entry
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-13-2012, 03:57 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