+ Reply to Thread
Results 1 to 6 of 6

Vba code to copy/move 12 sheets to master sheets

Hybrid View

tieyanna Vba code to copy/move 12... 06-24-2014, 07:22 AM
jaslake Re: Vba code to copy/move 12... 06-24-2014, 02:51 PM
tieyanna Re: Vba code to copy/move 12... 06-24-2014, 11:46 PM
jaslake Re: Vba code to copy/move 12... 06-25-2014, 10:57 AM
tieyanna Re: Vba code to copy/move 12... 06-25-2014, 08:18 PM
jaslake Re: Vba code to copy/move 12... 06-25-2014, 08:32 PM
  1. #1
    Registered User
    Join Date
    06-23-2014
    Location
    malaysia
    MS-Off Ver
    2010
    Posts
    30

    Vba code to copy/move 12 sheets to master sheets

    Guys!

    I need help to do my VBA coding. Got 12 Sheets for 12 month of Sales. Every Sheets are in same Header Format.

    For Column R (Status), there's Filter Data "TRUE" and "FALSE". I have to move/copy "TRUE" item into Sheet Aging 2014.

    Will somebody help me to provide me the coding? I manage to transfer using only one Sheets using Advanced Filter VBA, failed with other Sheet.

    I attached the file if somebody interested to help. Thanks

    Ros
    Attached Files Attached Files

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Vba code to copy/move 12 sheets to master sheets

    Hi tieyanna

    Welcome to the Forum!!

    Try this Code
    Option Explicit
    
    Sub Get_True()
      Dim ws As Worksheet, ws1 As Worksheet
      Dim rng As Range
      Dim LR As Long, LR1 As Long, x As Long
    
      Set ws = Sheets("Aging 2014")
    
      Application.ScreenUpdating = False
      With ws
        .UsedRange.Offset(8, 0).ClearContents
      End With
    
      For Each ws1 In ThisWorkbook.Sheets
        If Not ws1.Name = ws.Name Then
          With ws1
            LR1 = .Range("A" & .Rows.Count).End(xlUp).Row
            .Range("A8:R" & LR1).AutoFilter Field:=18, Criteria1:="TRUE"
            Set rng = .AutoFilter.Range
            x = rng.Columns(18).SpecialCells(xlCellTypeVisible).Count - 1
            If x >= 1 Then
              LR = ws.Cells.Find("*", ws.Cells(Rows.Count, Columns.Count), SearchOrder:=xlByRows, _
                                 SearchDirection:=xlPrevious).Row + 1
              .Range(.Cells(9, 1), .Cells(LR1, 18)).Copy
              ws.Range("A" & LR).PasteSpecial
              Application.CutCopyMode = False
            End If
            .AutoFilterMode = False
          End With
        End If
      Next ws1
      Application.ScreenUpdating = True
    End Sub
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    06-23-2014
    Location
    malaysia
    MS-Off Ver
    2010
    Posts
    30

    Re: Vba code to copy/move 12 sheets to master sheets

    Hi, appreciate that. Thousand flowrs for u dear.
    Got one more q, I can activate command button right.

    Sent from my LT26w using Tapatalk

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Vba code to copy/move 12 sheets to master sheets

    Hi tieyanna

    Sure, you can do that. Create a Forms Control Command Button and assign the Code to that Button. Need help with this let me know.

  5. #5
    Registered User
    Join Date
    06-23-2014
    Location
    malaysia
    MS-Off Ver
    2010
    Posts
    30

    Re: Vba code to copy/move 12 sheets to master sheets

    Jaslake...

    Succesfull. Thank you very much

    Sent from my LT26w using Tapatalk

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Vba code to copy/move 12 sheets to master sheets

    Hi tieyanna

    Great...glad it works for you.

    You're welcome...glad I could help.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. Vba code to copy/move 12 sheets to master sheets
    By tieyanna in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 06-24-2014, 11:16 PM
  2. How to copy or move sheets by using VBA code in Excel for Windows
    By aryan_vivek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-06-2012, 02:25 PM
  3. Move data rows from multiple sheets to a master sheet in another workbook
    By Nick_WBA in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-14-2012, 03:28 PM
  4. auto move data from master sheet to other sheets in excel 2007
    By tjm61 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-14-2011, 09:55 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