+ Reply to Thread
Results 1 to 3 of 3

I need to move data from main worksheet into multiple worksheets based on a criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    12-19-2012
    Location
    Daytona Beach, FL
    MS-Off Ver
    Excel 2010
    Posts
    2

    I need to move data from main worksheet into multiple worksheets based on a criteria

    I really need help. I have a file that combines data (multiple rows and columns) for several regions. I need to be able to copy data for each region and copy it into the new sheet for that region.
    Any help is greatly appreciated .
    Thank you,

    K

  2. #2
    Forum Contributor
    Join Date
    10-31-2010
    Location
    london
    MS-Off Ver
    Excel 365
    Posts
    152

    Re: I need to move data from main worksheet into multiple worksheets based on a criteria

    Something like this would work, im sure someone will be able to give you a better code but this would work.

    Sub test()
    
    Dim DataLR As Long
    Dim Region As String
    Dim Counter As Long
    Dim RegionLR As Long
    
    
    With ActiveSheet
    
            DataLR = Range("A" & Rows.Count).End(xlUp).Row
    
    
        For Counter = DataLR To 2 Step -1
            With Cells(Counter, "A")
                Region = Cells(Counter, "A").Value
                    Range("A" & Counter & ":F" & Counter).Select
                    Selection.Cut
                    Sheets(Region).Select
            End With
        
        With ActiveSheet
            RegionLR = Range("A" & Rows.Count).End(xlUp).Row
            RegionLR = RegionLR + 1
    
                ActiveSheet.Range("A" & RegionLR).Select
                    ActiveSheet.Paste
                    Selection.Copy
                    Selection.PasteSpecial Paste:=xlPasteAll
                    Application.CutCopyMode = False
                    Sheets("Data").Select
            End With
    
        Next Counter
           End With
    End Sub

  3. #3
    Registered User
    Join Date
    12-19-2012
    Location
    Daytona Beach, FL
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: I need to move data from main worksheet into multiple worksheets based on a criteria

    Thank you very much for the response. I tried to add the string into macro but it does not work. I am a total dummy then it comes to macros so I have no idea what is causing the problem. I attached file with the sample data. Individual tabs for the regions were created manually by copying and pasting the data into appropriate tabs. I have more than 50 regions with lots of rows and I waste so much time doing this manually . Please HELP!
    Attached Files Attached Files
    Last edited by ksenia81; 12-19-2012 at 05:47 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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