Results 1 to 4 of 4

Thread: Chop Worksheet!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Location
    N.Ireland
    Posts
    651

    Talking Chop Worksheet!

    Currently i'm using Cut & Paste to cut sections from a massive excel worksheet & then pasting the sections into new excel worksheets & renaming the sheets.

    Does anyone know how i can chop my excel worksheet into multiple sheets automatically?

    For example. Column A contains hundreds of country codes. The first 80 rows contain country code USA.

    Then row 81 to 141 change to country code IRE & so on....

    When the country code changes i need to chop those country rows into a new worksheet.

    Id appreciate anyones help,
    thanks
    Gilly

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Chop Worksheet!

    Moved To Office Development

  3. #3
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Chop Worksheet!

    VBA Code, loop, variables that point to sheets (like new sheets)...

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  4. #4
    Lively Member JustinLabenne's Avatar
    Join Date
    Jul 2005
    Location
    Ohio
    Posts
    64

    Re: Chop Worksheet!

    I am not quite grasping what your wanting here: Are there variable rows?

    This copies the range you talked about to a newly created sheet called countries:

    VB Code:
    1. Option Explicit
    2.  
    3. Sub ChopiT()
    4.     Dim wASht As Worksheet
    5.     Set wASht = ActiveSheet
    6.    
    7.     Sheets.Add
    8.     On Error GoTo ErrH
    9.     ActiveSheet.Name = "Countries"
    10.    
    11.     wASht.Range("A81:A141").Copy Sheets("Countries").Range("A1")
    12.    
    13. ErrExit:
    14.     Set wASht = Nothing
    15.     Exit Sub
    16. ErrH:
    17.     MsgBox Err.Description
    18.     GoTo ErrExit
    19. End Sub
    Justin Labenne
    www.jlxl.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width