+ Reply to Thread
Results 1 to 5 of 5

VBA for Copying to Specific Sheets

Hybrid View

  1. #1
    Registered User
    Join Date
    06-09-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2013
    Posts
    49

    VBA for Copying to Specific Sheets

    Hey guys,

    I'm not really too familiar with VBA and it seems my formula skills can't get this kind of result...
    So basically, I would want to copy a row of data depending on customer name and then copy it to a another sheet named after the customer name.
    The source data will be updated daily so I would like it to copy only the recent ones.

    Attached is a sample, please refer to the "Angelina" tab...

    TIA!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA for Copying to Specific Sheets

    Can't see any sample attached.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    06-09-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: VBA for Copying to Specific Sheets

    Hmm, can't seem to get the attachments to work, hope this works now.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-09-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: VBA for Copying to Specific Sheets

    Hello sir, I've attached the sheet, there was an error the first time. thank you!

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA for Copying to Specific Sheets

    Not the best approach, but does this help?

    Sub bronkista()
    Dim i As Long, x As Range, y As Range
    For i = 2 To Range("D" & Rows.Count).End(3).row
    Cells(i, "D").Select
    Set x = Columns(4).Find(What:=Cells(i, "D").Text, After:=ActiveCell, LookIn:=xlFormulas, lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False) '.Interior.ColorIndex = 6
        If Not x Is Nothing And x.Interior.ColorIndex = xlNone Then
            Cells(x.row, "A").Resize(1, 4).Copy Sheets(x.Value).Range("A" & Rows.Count).End(3)(2)
            Cells(x.row, "F").Copy Sheets(x.Value).Range("E" & Rows.Count).End(3)(2)
            Cells(x.row, "H").Copy Sheets(x.Value).Range("F" & Rows.Count).End(3)(2)
            x.Interior.ColorIndex = 6
            For Each y In Range("D2:D" & x.row - 1)
                If y.Value = x Then y.Interior.ColorIndex = 3
            Next y
        End If
        Set x = Nothing
    Next i
    Columns(4).Interior.ColorIndex = xlNone
    End Sub

+ 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] Copying and Pasting Rows from specific sheets
    By Nuccio92 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-07-2016, 02:01 PM
  2. [SOLVED] copying column A from specific sheets
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2015, 07:18 PM
  3. copying specific data between sheets automatically
    By SarahBo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-14-2015, 08:11 AM
  4. Copying data over to another sheets specific cells
    By cobydobbs in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 06-17-2013, 01:07 PM
  5. Copying row of data to new sheets if specific value exists in column
    By raz333 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2013, 03:53 PM
  6. Replies: 17
    Last Post: 02-01-2013, 12:20 PM
  7. MACRO for Copying specific values from multiple sheets
    By planetrisk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-24-2012, 11:42 AM

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