Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort to Various Sheets in Workbook

I have a workseet (Variance Analysis) in a workbook & want a Macro to
run through the information on this workseet sorting by Div # (Column
C) and then copying the entire row the correpsonding Division Sheet
within the Workbook. I have prepared a macro that was able to sort
the information but will not paste it the division sheet.. Below is my
attempt, does anyone have any suggestions?


Sheets("Variance Analysis").Select
Selection.AutoFilter
Selection.AutoFilter Field:=5, Criteria1:="0005"
Range("A2:e2").Select
Range(Selection, Selection.End(x1Down)).Select
Selection.Copy
Sheets("Div 5").Select
Range("b14").Select
ActiveSheet.Paste
Columns("c:F").Select
Columns("c:F").EntireColumn.AutoFit
Sheets("Variance Analysis").Select
Application.CutCopyMode = False
Selection.AutoFilter Field:=5, Criteria1:="0102"
Range("A2:d2").Select
Range(Selection, Selection.End(x1Down)).Select
Selection.Copy
Sheets("Div 102").Select
Range("b14").Select
ActiveSheet.Paste
Columns("c:F").Select
Columns("c:F").EntireColumn.AutoFit
Sheets("Variance Analysis").Select
Application.CutCopyMode = False
Selection.AutoFilter Field:=5, Criteria1:="0109"
Range("A2:d2").Select
Range(Selection, Selection.End(x1Down)).Select
Selection.Copy
Sheets("Div 109").Select
Range("b14").Select
ActiveSheet.Paste
Columns("c:F").Select
Columns("c:F").EntireColumn.AutoFit
Sheets("Variance Analysis").Select
Application.CutCopyMode = False
Selection.AutoFilter Field:=5, Criteria1:="0112"
Range("A2:d2").Select
Range(Selection, Selection.End(x1Down)).Select
Selection.Copy
Sheets("Div 112").Select
Range("b14").Select
ActiveSheet.Paste
Columns("c:F").Select
Columns("c:F").EntireColumn.AutoFit


Thanks

Steve B



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Sort to Various Sheets in Workbook

Debra Dalgleish has a nice technique for separating data into different sheets
at:

http://www.contextures.com/excelfiles.html#Filter
(look for: Create New Sheets from Filtered List
and: Update Sheets from Master)

(And watchout in your code: xldown is not ex-one-down, it's ex-ell-down.)

STEVEB wrote:

I have a workseet (Variance Analysis) in a workbook & want a Macro to
run through the information on this workseet sorting by Div # (Column
C) and then copying the entire row the correpsonding Division Sheet
within the Workbook. I have prepared a macro that was able to sort
the information but will not paste it the division sheet.. Below is my
attempt, does anyone have any suggestions?

Sheets("Variance Analysis").Select
Selection.AutoFilter
Selection.AutoFilter Field:=5, Criteria1:="0005"
Range("A2:e2").Select
Range(Selection, Selection.End(x1Down)).Select
Selection.Copy
Sheets("Div 5").Select
Range("b14").Select
ActiveSheet.Paste
Columns("c:F").Select
Columns("c:F").EntireColumn.AutoFit
Sheets("Variance Analysis").Select
Application.CutCopyMode = False
Selection.AutoFilter Field:=5, Criteria1:="0102"
Range("A2:d2").Select
Range(Selection, Selection.End(x1Down)).Select
Selection.Copy
Sheets("Div 102").Select
Range("b14").Select
ActiveSheet.Paste
Columns("c:F").Select
Columns("c:F").EntireColumn.AutoFit
Sheets("Variance Analysis").Select
Application.CutCopyMode = False
Selection.AutoFilter Field:=5, Criteria1:="0109"
Range("A2:d2").Select
Range(Selection, Selection.End(x1Down)).Select
Selection.Copy
Sheets("Div 109").Select
Range("b14").Select
ActiveSheet.Paste
Columns("c:F").Select
Columns("c:F").EntireColumn.AutoFit
Sheets("Variance Analysis").Select
Application.CutCopyMode = False
Selection.AutoFilter Field:=5, Criteria1:="0112"
Range("A2:d2").Select
Range(Selection, Selection.End(x1Down)).Select
Selection.Copy
Sheets("Div 112").Select
Range("b14").Select
ActiveSheet.Paste
Columns("c:F").Select
Columns("c:F").EntireColumn.AutoFit

Thanks

Steve B

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating workbook with an alpha sort sheet and a numeric sort shee cjlatta Excel Discussion (Misc queries) 2 January 28th 09 12:00 AM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Excel Worksheet Functions 4 August 17th 06 06:23 AM
add new sheets in a workbook with new sheets being a variable [email protected] Excel Discussion (Misc queries) 1 April 11th 06 08:38 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
how can I sort sheets within a workbook in excel piagax2 Excel Worksheet Functions 3 December 29th 05 10:24 PM


All times are GMT +1. The time now is 07:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"