+ Reply to Thread
Results 1 to 7 of 7

Combine Tab with Heading Lookup

  1. #1
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Combine Tab with Heading Lookup

    Hi, attached is a simple example, I have 3 tab where there is data. The data come from different source. I wan a code where it can combine all the data and put in respective heading. Refer result tab. The code which create new heading wherever there is new heading in the data tab. Data would be put under their respective heading tab. Can it be done?
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Combine Tab with Heading Lookup

    Hi. Anyone canhelp?

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

    Re: Combine Tab with Heading Lookup

    Hi jp16,
    try this
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Combine Tab with Heading Lookup

    Wow!!! Never knew its so complicated. I am thinking of looping each worksheet. If count of heading in data tab is 0 in "result" , then add in heading. Then loop thru the data sheet to last row of data sheet, den if heading match, den put the value into "result". Is what i say possible?

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this ‼


    Another way like you wrote as a beginner starter
    (to avoid the false forum message « Access Denied - Sucuri Website Firewall »
    - as a VBA code is not any SQL injection ! -
    I add a space between chars "c" & "e" of some Replace statements so just delete it …) :

    PHP Code: 
    Sub Demo1()
          Const 
    "IF(ISNA(MATCH(#,¤,0)),§,MATCH(#,¤,0))""IF(ISNA(MATCH(#,¤,0)),#)"
            
    Dim N&, S$, A$, VC&
        
    With Worksheets(1)
               .
    UsedRange.Clear
                Application
    .ScreenUpdating False
                Worksheets
    (2).UsedRange.Copy .[A1]
            For 
    3 To Worksheets.Count
                    S 
    = .UsedRange.Rows(1).Address(External:=True)
                    
    Worksheets(N).UsedRange.Rows(1).Address(External:=True)
                    
    Filter(Evaluate(Replac e(Replace(H"¤"S), "#"A)), FalseFalse)
                If 
    UBound(V) > -1 Then
                   
    .[A1].End(xlToRight)(12).Resize(, UBound(V) + 1).Value V
                    S 
    = .UsedRange.Rows(1).Address(External:=True)
                
    End If
                
    With Worksheets(N).UsedRange
                    C 
    = .Columns.Count 1
                    V 
    Evaluate(Replace(Replac e(Replace(F"¤"A), "#"S), "§"C))
                    
    Application.Index(.Resize(, C).ValueEvaluate("ROW(2:" & .Rows.Count ")"), V)
                
    End With
                    
    .Cells(.UsedRange.Rows.Count 11).Resize(UBound(V), UBound(V2)).Value V
            Next
        End With
             Application
    .ScreenUpdating True
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  6. #6
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Combine Tab with Heading Lookup

    Coz the number of data sheet varies. Its not fix at 3 or 4. Can be more and can be less. Hence i need the vba to go thru all the sheet.

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Combine Tab with Heading Lookup


    As you already got it ‼ Next time you should better try before writing anything …

+ 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] VBA to combine same worksheet in different workbooks into one without the heading
    By varmoh in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 03-05-2015, 08:29 AM
  2. How to combine two separate codes under the same sub heading in VBA?
    By jjin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2013, 05:53 AM
  3. [SOLVED] combine cells under a common heading
    By Xhawk57 in forum Excel General
    Replies: 2
    Last Post: 03-08-2006, 04:10 PM
  4. Lookup min & column heading
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 06:05 AM
  5. [SOLVED] Lookup min & column heading
    By Greg in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  6. Lookup min & column heading
    By Greg in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. [SOLVED] Lookup min & column heading
    By Greg in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 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