+ Reply to Thread
Results 1 to 13 of 13

need help of vba code to pull data multiple times into master sheet

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-23-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    143

    need help of vba code to pull data multiple times into master sheet

    Dear Excel & VBA Experts

    I need ur help on data extract from sheet to sheet through column header values, i have set of data on sheet1,2..loop end of sheet

    i want pull column data from multiple sheet column values into masterdata sheet depends upon column header values assigned in masterdata sheet.. my code works fine! but i want pull data if column header repeats more than one also

    SO_NBR this is one heading in multiple sheets i cant pull col values not more than once under if SO_NBR repeats more than once.


    
    sub pulldata()
    Dim rFind As Range, sFind As Range, sAddr As String, ws As Worksheet, rng As Range, LR&, ms As Worksheet
    Application.ScreenUpdating = 0
    Set ws = Sheets("MASTERDATA")
    ws.Range("A2:Fq" & Rows.Count).ClearContents
     NR = 2
     For Each ms In ActiveWorkbook.Sheets
     Set rng = ms.Range("A1:Fq1")
     LR = ms.Cells.Find("*", , , , xlByRows, xlPrevious).Row
           If ms.Name <> ws.Name Then
             For Each sFind In rng
                If Len(sFind) Then
                    With ws.Rows(1)
                        Set rFind = .Find(sFind, .Cells(.Cells.Count), xlValues, xlWhole)
                            If Not rFind Is Nothing Then
                                sAddr = rFind.Address
                                Do
                                sFind.Offset(1).Resize(LR - 1).Copy
                                ws.Cells(NR, rFind.Column).PasteSpecial xlValues
                                Loop While rFind.Address <> sAddr
                                sAddr = ""
                            End If
                    End With
                End If
             Next
           End If
           NR = ws.Cells.Find("*", , , , xlByRows, xlPrevious).Row + 1
     Next
      Application.CutCopyMode = 0
    Set ms = Nothing
    Set ws = Nothing
    Set rng = Nothing
    Set rFind = Nothing
    Application.ScreenUpdating = True
    End Sub
    find the attachment mentioned as expected result sheets is my requirement
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: need help of vba code to pull data multiple times into master sheet

    Hi John

    "3PL_PART_NAME" this name is not avaiable in provide workbook in Sheet1 Worksheet.
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  3. #3
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: need help of vba code to pull data multiple times into master sheet

    Hi John

    try this attached file and let me know

    Hope this will work
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    07-23-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    143

    Re: need help of vba code to pull data multiple times into master sheet

    Nice Sir It working almost 99% One is for H & I columns Heading values not filling...Pls check sir

  5. #5
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: need help of vba code to pull data multiple times into master sheet

    Hi John

    as i already informed you at post #2

    "3PL_PART_NAME" this name is not avaiable in provide workbook in Sheet1 Worksheet.

    dont forget to Click on Add Reputation if you feel the solution good

  6. #6
    Forum Contributor
    Join Date
    07-23-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    143

    Re: need help of vba code to pull data multiple times into master sheet

    Yes Sir... Really sorry I didnt notice that one where pointed mistake ..I made new attachment proper column header...find it to solve my problem...

    thanks alot sir
    Attached Files Attached Files
    Last edited by johnodys; 03-07-2014 at 08:37 AM. Reason: attachment

  7. #7
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: need help of vba code to pull data multiple times into master sheet

    Hi John

    where is the attachement ?

  8. #8
    Forum Contributor
    Join Date
    07-23-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    143

    Re: need help of vba code to pull data multiple times into master sheet

    Sorry sir I though it was uploaded but i missed it out...

  9. #9
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: need help of vba code to pull data multiple times into master sheet

    Hi John

    Today or Tmrow EOD i will provide updated file

  10. #10
    Forum Contributor
    Join Date
    07-23-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    143

    Re: need help of vba code to pull data multiple times into master sheet

    Ok Sir take ur own time...

  11. #11
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: need help of vba code to pull data multiple times into master sheet

    Hi John

    have a look to attached version 2 file and let me know
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    07-23-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    143

    Re: need help of vba code to pull data multiple times into master sheet

    Thanks Alot Sir Its works amazing!!!

  13. #13
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: need help of vba code to pull data multiple times into master sheet

    Glad I could help u

    1. If the suggestion helps you, then Click * to Add Reputation and give ur valuable comments
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    Quote Originally Posted by johnodys View Post
    Thanks Alot Sir Its works amazing!!!

+ 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. pull data from two sheet and paste into master sheet with desired column's only
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2014, 03:39 AM
  2. Filter data from a Master sheet based on multiple criteria by VBA code
    By judeprem in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2013, 03:27 PM
  3. Pull data from specific cells on multiple worksheets onto one master sheet
    By WorkforceMedia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-07-2013, 03:25 AM
  4. Replies: 3
    Last Post: 09-27-2012, 09:49 AM
  5. Pull a sequential pattern from another sheet multiple times
    By Affy in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-27-2012, 10:20 PM

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