+ Reply to Thread
Results 1 to 12 of 12

Move data from master in another sheets

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-21-2018
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    178

    Move data from master in another sheets

    Hi guys. i have a workbook with a master. I want if in col A is meet i, move raw in Sheet i, if p in sheet P, if f in sheet f, if l in sheet l. But i want to move with header "Range A1-M8".

  2. #2
    Forum Contributor
    Join Date
    08-21-2018
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    178

    Re: Move data from master in another sheets

    some help, pleasE?

  3. #3
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Move data from master in another sheets

    This will give you an idea...Cleaned up your sheet...
    Option Explicit
    
    Sub Move_Info_To_Sheets()
    Dim Val, ws As Worksheet, i As Long, lr As Long
    Application.ScreenUpdating = False
    With Sheet1
        lr = .Cells(Rows.Count, "A").End(xlUp).Row
        .Range(.Cells(2, 1), .Cells(Rows.Count, 1)).AdvancedFilter xlFilterCopy, , .Range("P1"), True
        With .Range("P1").CurrentRegion:  Val = .Value:  .Clear:  End With
        For i = 2 To UBound(Val)
            With .Cells(1).CurrentRegion
                .AutoFilter 1, Val(i, 1)
                If Evaluate("ISREF('" & Val(i, 1) & "'!A1)") = False Then
                    Set ws = Sheets.Add(After:=Sheets(1))
                    ws.Name = Val(i, 1)
                End If
                .SpecialCells(12).Copy Sheets(Val(i, 1)).Range("A1")
                .AutoFilter
                With Sheets(Val(i, 1))
                    .Rows(1).RowHeight = 50
                    .Range("A1:M1").Columns.AutoFit
                End With
            End With
        Next i
    End With
    Sheet1.Activate
    Application.ScreenUpdating = True
    End Sub
    Attached Files Attached Files
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  4. #4
    Forum Contributor
    Join Date
    08-21-2018
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    178

    Re: Move data from master in another sheets

    is working perfect, but how can to copy format?

  5. #5
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Move data from master in another sheets

    Meaning...
    Attached Files Attached Files
    Last edited by Sintek; 05-03-2019 at 09:03 AM.

  6. #6
    Forum Contributor
    Join Date
    08-21-2018
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    178

    Re: Move data from master in another sheets

    i want to copy some formats like in masters

  7. #7
    Forum Contributor
    Join Date
    08-21-2018
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    178

    Re: Move data from master in another sheets

    or there may be another solution ?

  8. #8
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Move data from master in another sheets

    What are you wanting...Explain in detail...
    Upload a sample file with your expected results...This way we can see exactly what you require...
    want to move with header "Range A1-M8".

    EDIT
    Try this...
    Attached Files Attached Files
    Last edited by Sintek; 05-03-2019 at 09:36 AM.

  9. #9
    Forum Contributor
    Join Date
    08-21-2018
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    178

    Re: Move data from master in another sheets

    i upload a sample file .

  10. #10
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Move data from master in another sheets

    See Post 8 edit Upload...

    If that is not what you want then perhaps someone else can better understand your requirement...

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

    Re: Move data from master in another sheets

    Sub test()
        Dim a, i As Long, dic As Object, temp As Boolean
        Application.ScreenUpdating = False
        temp = Application.CopyObjectsWithCells
        Application.CopyObjectsWithCells = True
        Set dic = CreateObject("Scripting.Dictionary")
        dic.CompareMode = 1
        With Sheets("sheet1")
            With .Range("a9", .Range("a" & Rows.Count).End(xlUp))
                .Value = Application.Trim(.Value)
                a = .Value
                For i = 2 To UBound(a, 1)
                    If (a(i, 1) <> "") * (Not dic.exists(a(i, 1))) Then
                        dic(a(i, 1)) = Empty
                        If Not Evaluate("isref('" & a(i, 1) & "'!a1)") Then
                            Sheets.Add(Sheets(Sheets.Count)).Name = a(i, 1)
                        End If
                        Sheets(a(i, 1)).Cells.Delete
                        .Parent.Cells.Copy
                        Sheets(a(i, 1)).Cells(1).PasteSpecial xlPasteColumnWidths
                        .Parent.Rows("1:9").Copy Sheets(a(i, 1)).Cells(1)
                        .AutoFilter 1, a(i, 1)
                        .EntireRow.Copy Sheets(a(i, 1)).Range("a9")
                        Application.Goto Sheets(a(i, 1)).Cells(1)
                        .AutoFilter
                    End If
                Next
            End With
        End With
        Application.CopyObjectsWithCells = temp
        Application.ScreenUpdating = True
    End Sub

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

    Re: Move data from master in another sheets

    You are welcome.

+ 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. Move data from multiple workbook columns to master sheets
    By pbdubai in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-04-2017, 12:20 AM
  2. trying to move data from master sheet to multiple tag sheets for printing
    By steve400243 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-03-2016, 05:45 PM
  3. [SOLVED] Vba code to copy/move 12 sheets to master sheets
    By tieyanna in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-25-2014, 08:32 PM
  4. 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
  5. 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
  6. 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