|
-
Sep 8th, 2005, 05:17 AM
#1
Thread Starter
Fanatic Member
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
-
Sep 8th, 2005, 06:01 AM
#2
Re: Chop Worksheet!
Moved To Office Development
-
Sep 8th, 2005, 06:21 AM
#3
Re: Chop Worksheet!
VBA Code, loop, variables that point to sheets (like new sheets)...
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...
-
Sep 9th, 2005, 07:22 AM
#4
Lively Member
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:
Option Explicit
Sub ChopiT()
Dim wASht As Worksheet
Set wASht = ActiveSheet
Sheets.Add
On Error GoTo ErrH
ActiveSheet.Name = "Countries"
wASht.Range("A81:A141").Copy Sheets("Countries").Range("A1")
ErrExit:
Set wASht = Nothing
Exit Sub
ErrH:
MsgBox Err.Description
GoTo ErrExit
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|