Results 1 to 3 of 3

Macro to copy and paste based on criteria to 11 separate sheets

Threaded View

  1. #1
    Registered User
    Join Date
    04-02-2013
    Location
    Arkansas, U.S.
    MS-Off Ver
    Excel 2007, 2013
    Posts
    16

    Macro to copy and paste based on criteria to 11 separate sheets

    I am starting with an excel sheet with a data range of A1:CJ2500
    The separating criteria is in Column C. The criteria is numerical: 1,2,3,4,5,6,7,8,9,10,11. Eleven is the last number criteria needed to separate.
    The number of rows will vary for each numerical criteria
    Each separate set of data needs to be pasted to A1 in sheet 1, sheet 2, sheet 3, etc to a max of 11 sheets.


    There is an attachment for a visual. In the example rows 1 thru 21 need to go to sheet 1. Rows 22 through 105 need to go to sheet 2(pasted to A1)


    I have included some code which will copy a range to sheet 1. However I don't know how to separate the data for separate sheets.

    Sub Macro2()
    '
    Dim Rng1 As Range
    Dim Sht As Worksheet
    Set Rng1 = Range("A1:CI2000")
    Set Sht = Sheets("Sheet1")
    Select Case UCase(Range("C1").Value)
    Case "1"
    Sht.Range("A1:CI2000").Value = Rng1.Value
    End Select
    End Sub

    Thank you for any help.
    Attached Files Attached Files
    Last edited by msmith7113; 04-11-2013 at 02:30 AM.

Thread Information

Users Browsing this Thread

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

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